S = input() T = input() if T not in S or len(T) == 1: print(-1) else: X = 0 s = len(S) t = len(T) for i in range(s): if S[i:i+t] == T: X += 1 print(X)