#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[2002], j2, j3, j1;
  int n, count = 0, l, i, j;
  scanf("%d", &n);
  scanf("%s", s);
  l = strlen(s);
  for (i = 3; i < l; i++) {
    j1 = s[i - 1];
    j2 = s[i - 2];
    j3 = s[i - 3];
    if (j1 == j2 && j2 == j3 && i % n == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
