#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int maxn = 100005;
vector<pair<int, int> > v;
string s, t;
bool update(int &l, int &r, int x) {
  int nl = v[x].first, nr = v[x].second;
  int L = max(l, nl), R = min(r, nr);
  if (L <= R) {
    l = L, r = R;
    return 1;
  } else {
    l = nl, r = nr;
    return 0;
  }
}
int main() {
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (int i = 0; i < n - m + 1; i++) {
    string tmp = s.substr(i, m);
    if (tmp == t) v.push_back(pair<int, int>(i, i + m - 1));
  }
  int sz = v.size();
  if (sz == 0) {
    cout << 0 << endl;
    return 0;
  }
  int l = v[0].first, r = v[0].second;
  int ans = 1;
  for (int i = 1; i < sz; i++) {
    if (!update(l, r, i)) ans++;
  }
  cout << ans << endl;
  return 0;
}
