S = list(input()) T = input() NT = len(T) if NT == 1 and T in S: print(-1) exit() cnt = 0 pont = 0 while pont < len(S)-NT+1: s = ''.join(S[pont:pont+NT]) if s == T: S.insert(pont+NT-1,'.') cnt += 1 pont += 1 print(cnt)