import sys s = input() t = input() ans = 0 while s.find(t) > -1: s = s[s.find(t) + len(t):] ans += 1 if len(t) == 1 and ans > 0: print(-1) sys.exit() print(ans)