S = list(input()) T = list(input()) if len(T) == 1: if T[0] in S: print(-1) else: print(0) exit() ans = 0 for i in range(len(S) - len(T) + 1): if S[i:i+len(T)] == T: S[i+len(T)-2] = "." ans += 1 print(ans)