s = str(input()) t = str(input()) import re m = re.findall(t, s) #print(m) if len(t) == 1: if len(m) == 0: print(0) else: print(-1) elif t == t[0]*len(t): s_ = s.replace(t, t[0]) #print(s_) ans = len(m) + len(re.findall(t, s_)) print(ans) else: print(len(m))