def f(): S=input() T=input() n=len(T) if n<2: return -1 k=0 for i in range(1000): k= S.find(T,k) if k<0: return i k+=n-1 return i print(f())