# coding: utf-8 # Your code here! S=input() T=input() if T in S and len(T)==1: print(-1) exit() ans=0 temp="" for i in range(len(S)): temp+=S[i] if len(temp)>len(T): temp=temp[1:] if T==temp: ans+=1 temp=S[i] #print(temp) print(ans)