S = input().strip() T = input().strip() if len(T) == 1: print(-1) exit(0) cnt = 0 pos = 0 while True: tmp = S.find(T, pos) if tmp > 0: cnt += 1 S = S[:tmp - 1] + '.' + S[tmp - 1:] pos = tmp + len(T) else: break print(cnt)