#include <bits/stdc++.h>
using namespace std;
int M, N, ans;
string pat, txt;
int lps[100005];
void computeLPS(int M) {
  int len = 0, i = 1;
  lps[0] = 0;
  while (i < M) {
    if (pat[i] == pat[len]) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0) {
        len = lps[len - 1];
      } else {
        lps[i] = 0;
        i++;
      }
    }
  }
}
int main() {
  cin >> txt >> pat;
  M = pat.length();
  N = txt.length();
  int j = 0, i = 0;
  computeLPS(M);
  while (i < N) {
    if (pat[j] == txt[i]) {
      j++, i++;
    }
    if (j == M) {
      ans++;
      j = 0;
    } else if (i < N and pat[j] != txt[i]) {
      if (j)
        j = lps[j - 1];
      else
        i++;
    }
  }
  cout << ans << endl;
  return 0;
}
