#include using namespace std; string s, t; int main() { cin >> s >> t; int len = t.size(); if (len == 1) { cout << (s.find(t) == string::npos ? 0 : -1) << endl; } else { int cnt = 0; int i = 0; while (i < s.size()) { if (s.substr(i, len) == t) { ++cnt; i += len - 1; } else { ++i; } } cout << cnt << endl; } }