#include <bits/stdc++.h>
using namespace std;
long long mod(long long a, long long b) { return (a % b + b) % b; }
long long modpow(long long a, long long b, long long m) {
  long long ret = 1;
  a = mod(a, m);
  b = mod(b, m);
  while (b--) ret = mod(ret * a, m);
  return ret;
}
string s1, s2;
int main() {
  std::ios::sync_with_stdio(false);
  long long c = 0, hp1 = 0, hp2 = 0, htemp1 = 0, htemp2 = 0;
  cin >> s1 >> s2;
  long long ls1 = s1.size(), ls2 = s2.size();
  for (long long i = 0; i < ls1; i++) s1[i] = (s1[i] - '0');
  for (long long i = 0; i < ls2; i++) s2[i] = (s2[i] - '0');
  for (long long i = 0; i < ls2; i++) {
    hp1 = mod(hp1 * 10000019 + s2[i], 10000019);
    hp2 = mod(hp2 * 10000019 + s2[i], 10000079);
  }
  for (long long i = 0; i < ls2; i++) {
    htemp1 = mod(htemp1 * 10000019 + s1[i], 10000019);
    htemp2 = mod(htemp2 * 10000019 + s1[i], 10000079);
  }
  long long skiplen = 0;
  if (hp1 == htemp1 && hp2 == htemp2) {
    c++;
    skiplen = ls2 - 1;
  }
  long long e1 = modpow(10000019, ls2 - 1, 10000019);
  long long e2 = modpow(10000019, ls2 - 1, 10000079);
  for (long long i = ls2; i < ls1; i++) {
    htemp1 = mod(htemp1 - mod(s1[i - ls2] * e1, 10000019), 10000019);
    htemp1 = mod(htemp1 * 10000019, 10000019);
    htemp1 = mod(htemp1 + s1[i], 10000019);
    htemp2 = mod(htemp2 - mod(s1[i - ls2] * e2, 10000079), 10000079);
    htemp2 = mod(htemp2 * 10000019, 10000079);
    htemp2 = mod(htemp2 + s1[i], 10000079);
    if (htemp1 == hp1 && hp2 == htemp2 && skiplen <= 0) {
      c++;
      skiplen = ls2;
    }
    skiplen--;
  }
  cout << c << endl;
}
