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