s = input() t = input() if len(t) == 1: if t in s: print(-1) else: print(0) exit() ans = 0 pos = 0 n = len(t) while pos + n <= len(s): if s[pos:pos + n] == t: ans += 1 pos += n - 1 else: pos += 1 print(ans) exit()