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