S = input() BOT = input() if len(BOT) == 1 and ans != 0: print("-1") elif len(BOT) == 2 and BOT[0]==BOT[1]: cnt = 0 for i in range(len(S)-len(BOT)+1): if S[i:i+len(BOT)] == BOT: cnt += 1 print(cnt) else: print(S.count(BOT))