s = str(input()) t = str(input()) if t in s: if len(t)<=2: print("-1") else: print(s.count(t)) else: print("0")