#include <bits/stdc++.h>
using namespace std;
char ch[2005];
int n, a[2005];
int main() {
  while (cin >> n) {
    scanf("%s", ch + 1);
    int len = strlen(ch + 1);
    memset(a, 0, sizeof(a));
    int cnt = 0;
    for (int i = 1; i * n + 1 <= len; i++) {
      int k = i * n + 1;
      if (ch[k - 1] == ch[k - 2] && ch[k - 1] == ch[k - 3]) cnt++;
    }
    cout << cnt << endl;
    ;
  }
  return 0;
}
