S = input() T = input() if len(T)==1 and S.count(T)>0: print(-1) exit() cnt = 0 temp = S.find(T) while temp>=0: S = S[:temp+len(T)-1] + '.' + S[temp+len(T)-1:] temp = S.find(T) cnt+=1 print(cnt)