import sys S=input() T=input() if len(T)==1 and T in S: print('-1') sys.exit() if not(T in S): print(0) sys.exit() L=len(S) M=len(T) i=0 P=0 while M-L+1>i: if S[i:i+M]==T: S=S[:i+M-1]+'.'+S[i+M:] P=P+1 i=i+1 print(P)