S = input() T = input() count = 0 while True: if T in S: replaceChar = T[:-1] + "." + T[-1] S = S.replace(T, replaceChar, 1) count += 1 else: break print(count)