S = str(input())
T = str(input())

i = 0
cnt = 0

if len(T) == 1 and T in S:
    print(-1)
    exit()

while i < len(S)-len(T)+1:
    if S[i:i+len(T)] == T:
        cnt += 1
        i += len(T)-1
    else:
        i += 1

print(cnt)