S = input() T = input() cnt = -1 if not T in S: cnt = 0 elif T in S: cnt = S.count(T) print(cnt)