#include #include #include using namespace std; int main(){ string S; cin >> S; string T; cin >> T; int N = S.size(); int M = T.size(); vector p; for (int i = 0; i <= N - M; i++){ bool ok = true; for (int j = 0; j < M; j++){ if (S[i + j] != T[j]){ ok = false; } } if (ok){ p.push_back(i); } } if (p.empty()){ cout << 0 << endl; } else { if (M == 1){ cout << -1 << endl; } else { int cnt = p.size(); int ans = 0; int prev = 0; for (int i = 0; i < cnt; i++){ if (prev <= p[i]){ prev = p[i] + M - 1; ans++; } } cout << ans << endl; } } }