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