#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define ld long double #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); string s, t; cin >> s >> t; if (t.size() == 1) { cout << 0 << endl; return 0; } int cur = 0; vector v; while (cur < s.size()) { if (s[cur] == t.front()) { int l = cur; int r = 0, cnt = 0; while (r < t.size()) { if (s[l] != t[r] || cnt == t.size() || l >= s.size()) break; cnt++; l++, r++; } if (cnt == t.size()) v.push_back({cur, l - 1}); } cur++; } ll ans = v.size(); rep(i, v.size() - 1) { if (v[i].second > v[i + 1].first) ans--, i++; } cout << ans << endl; }