def f(): S=input() T=input() n=len(T) if n<2: if S.find(T)<0: return 0 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())