S = str(input()) T = str(input()) N = len(S) lenT = len(T) if lenT == 1 and T in S: print(-1) elif lenT == 2 and T[0] == T[1]: n = 0 ans = 0 for i in range(N+lenT): if T == S[i:i+lenT]: ans += 1 n += 1 if i == N+n-1: break print(ans) else: print(S.count(T))