import sys, collections sys.setrecursionlimit(500005) stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().strip() s = input() t = input() ans = s.count(t) if ans: if len(t) == 1: ans = -1 else: ls = len(s) lt = len(t) ans = 0 i = 0 j = i + lt while j <= ls: if s[i:j] == t: ans += 1 i = j - 1 else: i += 1 j = i + lt print(ans)