/* Author haleyk10198 */
/* 作者: haleyk10198 */
#include <bits/stdc++.h>
#define MOD 1000000007
#define LINF (1LL<<60)
#define INF 2147483647
#define PI 3.1415926535897932384626433
#define ll long long
#define pii pair<int,int>
#define mp(x,y) make_pair((x),(y))
#define MAXN 262144
using namespace std;
string itos(int x){
stringstream ss;
ss << x;
return ss.str();
}
map<char, int> m1;
const string gene = "ACGT";
string s, t;
int n, m, k, rescnt;
vector<complex<double> > vs[4], vt[4];
void fft(vector<complex<double> > &x){
int n = x.size();
if(n == 1)
return ;
vector<complex<double> > v[2];
for(int i = 0; i < n; i++)
v[i%2].push_back(x[i]);
for(int i = 0; i < 2; i++)
fft(v[i]);
for(int i = 0 ; i < n/2; i++){
double ar = 2*PI*i/n;
complex<double> a, b, now = complex<double>(cos(ar), sin(ar));
a = v[0][i];
b = now*v[1][i];
x[i] = a+b;
x[i+n/2] = a-b;
}
}
void ifft(vector<complex<double> > &x){
int n = x.size();
if(n == 1)
return;
vector<complex<double> > v[2];
for(int i = 0; i < n; i++)
v[i%2].push_back(x[i]);
for(int i = 0; i < 2; i++)
fft(v[i]);
for(int i = 0 ; i < n/2; i++){
double ar = -2*PI*i/n;
complex<double> a, b, now = complex<double>(cos(ar), sin(ar));
a = v[0][i];
b = now*v[1][i];
x[i] = a+b;
x[i+n/2] = a-b;
}
for(auto &y: x)
y /= n;
}
int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
for(auto x: gene){
int sz = m1.size();
m1[x] = sz;
}
cin >> n >> m >> k >> s >> t;
{
for(int i = 0; i < 4; i++)
vs[i] = vector<complex<double> >(MAXN, 0);
{
vector<int> lst = vector<int>(4, -MOD);
int st = MAXN-n;
for(int i = 0; i < n; i++){
lst[m1[s[i]]] = i;
for(int j = 0; j < 4; j++)
if(lst[j]+k >= i)
vs[j][st+i] = 1;
}
lst = vector<int>(4, MOD);
for(int i = n; i; ){
--i;
lst[m1[s[i]]] = i;
for(int j = 0; j < 4; j++)
if(lst[j]-k <= i)
vs[j][st+i] = 1;
}
st = MAXN - m;
for(int i = 0; i < 4; i++)
vt[i] = vector<complex<double> >(MAXN, 0);
for(int i = 0; i < m; i++)
vt[m1[t[i]]][i+st] = 1;
}
for(int i = 0; i < 4; i++)
reverse(vt[i].begin(), vt[i].end());
}
for(int i = 0; i < 4; i++){
fft(vs[i]);
fft(vt[i]);
for(int j = 0; j < MAXN; j++)
vs[i][j] *= vt[i][j];
ifft(vs[i]);
}
for(int i = 0; i < MAXN; i++){
int tt = 0;
for(int j = 0; j < 4; j++)
tt += round(vs[j][i].real());
if(tt == m)
rescnt++;
}
cout << rescnt << endl;
return 0;
}
LyogQXV0aG9yIGhhbGV5azEwMTk4ICovCi8qIOS9nOiAhTogIGhhbGV5azEwMTk4ICovCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgoKI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIExJTkYgKDFMTDw8NjApCiNkZWZpbmUgSU5GIDIxNDc0ODM2NDcKI2RlZmluZSBQSSAzLjE0MTU5MjY1MzU4OTc5MzIzODQ2MjY0MzMKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBwaWkgcGFpcjxpbnQsaW50PgojZGVmaW5lIG1wKHgseSkgbWFrZV9wYWlyKCh4KSwoeSkpCiNkZWZpbmUgTUFYTiAyNjIxNDQKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJpbmcgaXRvcyhpbnQgeCl7CglzdHJpbmdzdHJlYW0gc3M7CglzcyA8PCB4OwoJcmV0dXJuIHNzLnN0cigpOwp9CgptYXA8Y2hhciwgaW50PiBtMTsKY29uc3Qgc3RyaW5nIGdlbmUgPSAiQUNHVCI7CnN0cmluZyBzLCB0OwoKaW50IG4sIG0sIGssIHJlc2NudDsKCnZlY3Rvcjxjb21wbGV4PGRvdWJsZT4gPiB2c1s0XSwgdnRbNF07Cgp2b2lkIGZmdCh2ZWN0b3I8Y29tc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