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