import sys s = input() t = input() ans = 0 key = 0 if len(t) == 1: for i in range(len(s)): if s[i] == t: print(-1) sys.exit() for i in range(len(s)): if s[i-key:i+1] != t[:key+1]: key = 0 else: key += 1 if key == len(t): ans += 1 key = 0 if s[i] == t[0]: key = 1 print(ans)