#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::string s, t;
  std::getline(std::cin, s);
  std::getline(std::cin, t);
  const int size = (int)t.size();
  (t += '$') += s;
  std::vector<std::size_t> p(t.size() + 1);
  long ans = 0;
  for (std::size_t i = 1; i != t.size(); ++i) {
    if (p[i] == size - 1 && t[size - 1] == t[i]) {
      t[i] = '#';
      ++ans;
    }
    std::size_t len = p[i];
    while (len && t[len] != t[i]) len = p[len];
    if (t[len] != t[i])
      p[i + 1] = 0;
    else
      p[i + 1] = len + 1;
  }
  std::cout << ans << "\n";
  return 0;
}
