s = list(input()) t = list(input()) n,m = len(s), len(t) if m == 1: if t[0] in s: print(-1) else: print(0) exit() if m > n: print(0) exit() s += ["0"]*1001 ans = 0 i = 0 while i < n: if s[i:i+m] == t: ans += 1 i += m-1 else: i += 1 print(ans)