import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines s = readline().decode().strip() t = readline().decode().strip() if (len(t) == 1 and s.count(t) > 0): print(-1) exit() ans = 0 while True: pos = s.find(t) if pos == -1: break ans += 1 s = s[pos + len(t) - 1:] print(ans)