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