#include using namespace std; #define ll long long #define endl "\n" #define rep(i, a, n) for (int i = a; i < n; ++i) int main() { string s, t; cin >> s >> t; if (t.length() == 1) { rep(i, 0, s.length()) { if (s[i] == t[0]) { cout << "-1" << endl; return 0; } } cout << "0" << endl; return 0; } int cnt = 0; int pos = 0; int i; while ((i = s.find(t, pos)) != string::npos) { cnt++; pos = t.length() - 1 + i; } cout << cnt << endl; return 0; }