def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 S=list(input()) T=list(input()) ns=len(S) nt=len(T) if nt==1 and T[0] in S: print(-1) exit() cnt=0 for i in range(ns-nt+1): if S[i:i+nt]==T: S[i+nt-2]="_" cnt+=1 print(cnt) main()