# #define c(u,s)for(;s[++i];j+=!q,u)for(;q=s[i]^t[j],j*q;)j=f[j];
q, f[1 << 20], i, j, x;
main() {
char s[q = 1E6], t[q];
scanf("%s%s", s, t);
c(f[i + 1] = j, t)i = -1, j = 0;
c(x += !t[j], s)printf("%d", x);
}
#include <bits/stdc++.h>
char x = 233, a[1000005], b[1000005];
long long n, m, i, A, T = 1, B, ans;
int main() {
for (gets(a), gets(b), n = strlen(a), m = strlen(b); i < m; ++i)
A = A * x + a[i], B = B * x + b[i], T = T * x;
for (ans = A == B; i < n; ++i)
A = A * x + a[i] - T * a[i - m], ans += A == B;
printf("%d\n", ans);
}