S = input() T = input() if len(T) == 1: if T in S: print(-1) else: print(0) else: ok = T[0] + "." + T[1:] for _ in range(10): S = S.replace(T, ok) print(S.count("."))