s=input() t=input() if s==t and len(s)==1: print(-1) exit() tmp=s.count(t) print(tmp)