s =input() t =input() if len(t) == 1: print(-1) exit() i=0 cnt=0 while i < len(s): if s[i:i+len(t)] == t: cnt+=1 i = i + len(t) - 1 else: i += 1 print(cnt)