import math import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LS(): return list(sys.stdin.readline().rstrip().split()) s = S() t = S() if not t in s: print(0) elif len(t) == 1: print(-1) else: cnt = 0 n = len(t) while t in s: p = s.find(t) s = s[p+n-1:] cnt += 1 print(cnt)