s0=input().lower() str=list(map(str,input().lower().split())) t=str.count(s0) if t==0: print(-1) else: i=str.index(s0) print(f"{t} ",end="") print(i)