#include <bits/stdc++.h>
using namespace std;
string s, t;
int lps[100];
int n, m;
int ans = 0;
void compute() {
  int len = 0;
  lps[0] = 0;
  int i = 1;
  while (i < m) {
    if (t[i] == t[len]) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0)
        len = lps[len - 1];
      else {
        lps[i] = 0;
        i++;
      }
    }
  }
}
void solve() {
  int i = 0, j = 0;
  while (i < n) {
    if (t[j] == s[i]) {
      j++;
      i++;
    }
    if (j == m) {
      ans++;
      j = 0;
    } else if (i < n && t[j] != s[i]) {
      if (j != 0)
        j = lps[j - 1];
      else
        i = i + 1;
    }
  }
}
int main() {
  cin >> s >> t;
  n = s.length(), m = t.length();
  compute();
  solve();
  cout << ans;
  return 0;
}
