S = input() T = input() if len(T) == 1: print("-1") print(S.count(T))