s = input() t = input() if len(t) == 1: if t in s: print(-1) else: print(0) else: print(s.count(t))