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 1: try: if s[pos:pos + n] == t: ans += 1 pos = pos + n - 1 else: pos += 1 except IndexError: break print(ans)