#include <bits/stdc++.h> using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000 int main(){ string S,T; cin>>S>>T; int ans = 0; while(true){ if(ans==-1)break; if(T.size()>S.size())break; bool f = true; for(int i=0;i<S.size()-T.size()+1;i++){ if(S.substr(i,T.size())==T){ f=false; ans++; S.insert(S.begin()+i+T.size()-1,','); if(T.size()==1)ans=-1; break; } } if(f)break; } cout<<ans<<endl; return 0; }