S = list(str(input())) T = str(input()) N = len(S) lenT = len(T) if lenT == 1 and T in S: print(-1) else: n = 0 ans = 0 for i in range(N+lenT): if T == "".join(S[i:i+lenT]): S.insert(i+lenT-1,".") ans += 1 n += 1 if i == N+n-1: break print(ans)