#include <bits/stdc++.h>
using namespace std;
int n, m, f, inc, S[100005], lst, lstmax, nr, pz[100005], k;
char a[100005], b[100005];
int main() {
  cin >> (b + 1);
  m = strlen(b + 1);
  cin >> (a + 1);
  n = strlen(a + 1);
  S[0] = -1;
  S[1] = 0;
  for (int i = 2; i <= n; i++) {
    int k = i - 1;
    while (k != 0 && a[S[k] + 1] != a[i]) k = S[k];
    S[i] = S[k] + 1;
  }
  f = 0;
  for (int i = 1; i <= m; i++) {
    while (f && a[f + 1] != b[i]) f = S[f];
    if (a[f + 1] == b[i]) f++;
    if (f == n) {
      pz[++k] = i - n + 1;
      f = S[f];
    }
  }
  for (int i = 1; i <= k; i++) {
    inc = pz[i];
    lst = inc + n - 1;
    if (inc > lstmax) {
      nr++;
      lstmax = lst;
    }
  }
  cout << nr;
  return 0;
}
