S = input() T = input() M = len(S) N = len(T) if N != 1: dot = [0 for _ in range(M)] for i in range(M): if i + N > M: break for j in range(N): if S[i + j] != T[j]: break if j != 0 and dot[i + j]: break else: dot[i + N - 1] = 1 print(sum(dot)) else: if T in S: print(-1) else: print(0)