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