import sys input = sys.stdin.readline S=input().strip() T=input().strip() if len(T)==1 and T in S: print(-1) sys.exit() i=0 ANS=0 L=len(T) while i<len(S): if S[i:i+L]==T: ANS+=1 i+=L-1 else: i+=1 print(ANS)