s = str(input()) t = str(input()) if len(t) == 1: if t in set(list(s)): print(-1) else: print(0) exit() def z_algorithm(s): n = len(s) Z = [0]*n Z[0] = n i = 1 j = 0 while i < n: while i+j < n and s[j] == s[i+j]: j += 1 Z[i] = j if j == 0: i += 1 continue k = 1 while i+k < n and k+Z[k] < j: Z[i+k] = Z[k] k += 1 i += k j -= k return Z Z = z_algorithm(t+s) #print(Z) ans = 0 i = len(t) while i < len(Z): if Z[i] >= len(t): ans += 1 i += len(t)-1 else: i += 1 print(ans)