#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- int N,M,K; string S,T,SA,SB,TA,TB; using VT = string; bitset<512000> SC,TC,mask; vector Zalgo(VT s) { vector v(1,s.size()); for(int i=1,l=-1,r=-1;ir)?i:(r+1); while(r>N>>M>>K>>S>>T; FORR(c,S) { if(c>='a'&&c<='z') { SA+=c; SB+="a"; } else { SA+=c-'A'+'a'; SB+="A"; } } FORR(c,T) { if(c>='a'&&c<='z') { TA+=c; TB+="a"; } else { TA+=c-'A'+'a'; TB+="A"; } } TA+="*"+SA; T+="*"+S; FOR(i,N) SC[i]=SB[i]=='a'; FOR(i,M) { TC[i]=TB[i]=='a'; mask[i]=1; } auto ZA=Zalgo(TA); auto Z=Zalgo(T); int ret=0; FOR(i,N-M+1) if(Z[i+1+M]>i; TT&=mask; if(TT.count()<=K) ret++; } cout<