s=raw_input() s+=raw_input() a="o" i=0 while True: if s.find(a)==-1: break a+="o" i+=1 print i