#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7, INF = 0x3F3F3F3F3F3F3F3F;
const int inf = 0x3F3F3F3F;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string t, p;
  cin >> t >> p;
  long long int i = 1, j = 0;
  long long int arr[p.length() + 10];
  arr[0] = 0;
  long long int ans = 0;
  while (i < p.length()) {
    if (p[i] == p[j]) {
      j++;
      arr[i] = j;
      i++;
    } else {
      if (j != 0) {
        j = arr[j - 1];
      } else {
        arr[i] = 0;
        i++;
      }
    }
  }
  i = 0;
  j = 0;
  while (i < t.length()) {
    if (t[i] == p[j]) {
      i++;
      j++;
    }
    if (j == p.length()) {
      ans++;
      j = 0;
    } else if (i < t.length() && t[i] != p[j]) {
      if (j != 0) {
        j = arr[j - 1];
      } else {
        i++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
