S = input() T = input() if len(S) == 1 or len(T) == 1: print(-1) else: start = 0 count = 0 while True: index = S[start:].find(T) if index != -1: start = index+start start += len(T)-1 count += 1 else: print(count) break