#1005 S = input() T = input() if len(T)==1: if T in S: print(-1) else: print(0) else: ans = 0 i = 0 while i < len(S): if S[i] == T[0]: if S[i:i+len(T)] == T: ans += 1 i += len(T)-1 else: i += 1 else: i += 1 print(ans)