#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 1e5 + 5;
int N, M, ans;
int nxt[MAXN];
char s[MAXN], t[MAXN];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  N = strlen(s + 1);
  M = strlen(t + 1);
  int j = 0;
  for (int i = 2; i <= M; i++) {
    while (j && t[i] != t[j + 1]) j = nxt[j];
    if (t[i] == t[j + 1]) j++;
    nxt[i] = j;
  }
  int lst = 0;
  j = 0;
  for (int i = 1; i <= N; i++) {
    while (j && s[i] != t[j + 1]) j = nxt[j];
    if (s[i] == t[j + 1]) j++;
    if (j == M) {
      if (i - M + 1 > lst) {
        if (lst) ans++;
        lst = i;
      }
      j = nxt[j];
    }
  }
  if (lst) ans++;
  printf("%d\n", ans);
  return 0;
}
