#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int k;
cin >> k;
string s;
cin >> s;
int l, r, flag=0, ans=0;
for(int i=0; i<s.size()-k+1; i++)
{
flag=0;
l=i;
r=i+k-1;
for(int j=0; j<k/2; j++)
{
if(s[l+j]!=s[r-j]){
flag=1;
break;
}
}
if(flag==0){
ans++;
}
}
cout << ans;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cglpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKCWNpbi50aWUoMCk7CglpbnQgazsKCWNpbiA+PiBrOwoJc3RyaW5nIHM7CgljaW4gPj4gczsKCWludCBsLCByLCBmbGFnPTAsIGFucz0wOwoJZm9yKGludCBpPTA7IGk8cy5zaXplKCktaysxOyBpKyspCgl7CgkJZmxhZz0wOwoJCWw9aTsKCQlyPWkray0xOwoJCWZvcihpbnQgaj0wOyBqPGsvMjsgaisrKQoJCXsKCQkJaWYoc1tsK2pdIT1zW3Ital0pewkKCQkJCWZsYWc9MTsKCQkJCWJyZWFrOwoJCQl9CgkJfQoJCWlmKGZsYWc9PTApewoJCQlhbnMrKzsKCQl9Cgl9Cgljb3V0IDw8IGFuczsKCXJldHVybiAwOwp9