while True: try: m = input().lower() n = input().lower() for n in m: leng = len(m)-len(m.strip(n))+1 print(leng) except: break