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) else: print(len(m))