//1005 bot taisaku #include #define rep(i ,n) for(int i=0;i<(int)(n);++i) using namespace std; typedef long long int int64; typedef unsigned long long uint64; int main(){ string s , t; cin >> s >> t; bool bot = false; int counter = 0; if(t.size() == 1 ){ rep(i ,s.size()){ if(t[0] == s[i]) { bot = true; break; } } } else { int pos = 0 ; int i; while((i = s.find(t,pos))!=string::npos){ ++counter; pos = t.size()-1+i; } } cout << ( bot ? -1 : counter ) << endl; }