如题,由于loj炸了
此片代码正确性有待考究
#include<bits/stdc++.h>
#define re return
#define reg register
#define ll long long
#define inc(i,l,r) for(register long long i=l;i<=r;++i)
#define dec(i,l,r) for(register long long i=l;i>=r;--i)
const int mod=1e9+7,BASE=233,maxn=1e6+5;
/*char buf[1<<21],*p1,*p2;
inline int getc(){re p1==p2 and (p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
template<typename T>inline void rd(T&x)
{
char c;bool f=0;
while((c=getc())<'0'||c>'9')if(c=='-')f=1;
x=c^48;
while((c=getc())>='0'&&c<='9')x=(x*10+(c^48))%mod;
if(f)x=-x;
}*/
using namespace std;
ll power[maxn],sum[maxn],sumb,ans;
char a[maxn],b[maxn];
int main()
{
freopen("in.txt","r",stdin);
scanf("%s",a+1);scanf("%s",b+1);
int n=strlen(a+1),m=strlen(b+1);
power[0]=1;
inc(i,1,n)power[i]=(power[i-1]*BASE)%mod;
inc(i,1,n)sum[i]=(sum[i-1]*BASE+a[i])%mod;
inc(i,1,m)sumb=(sumb*BASE+b[i])%mod;
inc(i,0,n-m)
if((sum[i+m]-(sum[i]*power[m])%mod+mod)%mod==sumb)++ans;
printf("%lld",ans);
re 0;
}