#include <iostream>
#include <cstring>
using namespace std;
const int max_length=30001;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int k;
cin >> k;
char s[max_length];
cin >> s;
int l, r, flag=0, ans=0;
for(int i=0; i<strlen(s)-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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbWF4X2xlbmd0aD0zMDAwMTsgCiAKaW50IG1haW4oKSB7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoMCk7CiAgICBpbnQgazsKICAgIGNpbiA+PiBrOwogICAgY2hhciBzW21heF9sZW5ndGhdOwogICAgY2luID4+IHM7CiAgICBpbnQgbCwgciwgZmxhZz0wLCBhbnM9MDsKICAgIGZvcihpbnQgaT0wOyBpPHN0cmxlbihzKS1rKzE7IGkrKykKICAgIHsKICAgICAgICBmbGFnPTA7CiAgICAgICAgbD1pOwogICAgICAgIHI9aStrLTE7CiAgICAgICAgZm9yKGludCBqPTA7IGo8ay8yOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBpZihzW2wral0hPXNbci1qXSl7IAogICAgICAgICAgICAgICAgZmxhZz0xOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYoZmxhZz09MCl7CiAgICAgICAgICAgIGFucysrOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgYW5zOwogICAgcmV0dXJuIDA7Cn0=