S = input() T = input() if len(T) == 1: print(-1) exit() result = 0 p = 0 while True: p = S.find(T, p) if p == -1: break S = S[:p + len(T) - 1] + '.' + S[p + len(T) - 1:] result += 1 print(result)