#include <bits/stdc++.h>
char o[100011];
char u[41];
int pi[42];
int n, m;
int ans = 0;
void make_pi() {
  int i = 0, j = -1;
  pi[0] = -1;
  while (i < m) {
    if (j == -1 || (j >= 0 && u[i] == u[j])) {
      i++;
      j++;
      pi[i] = j;
    } else
      j = pi[j];
  }
}
void kmp() {
  int i = 0, j = 0;
  while (i < n) {
    if (j == -1 || (j >= 0 && o[i] == u[j])) {
      i++;
      j++;
    } else
      j = pi[j];
    if (j == m) {
      ans++;
      j = 0;
    }
  }
}
int main() {
  scanf("%s", o);
  n = strlen(o);
  scanf("%s", u);
  m = strlen(u);
  make_pi();
  kmp();
  printf("%d", ans);
  return 0;
}
