S = input() T = input() if len(T)==1: print(-1) exit() ans = 0 while T in S: i = S.index(T) ans += 1 S = S[i+len(T):] print(ans)