#include <bits/stdc++.h>
int main() {
  char c[2002];
  int i, n, sum = 0;
  int t, flag = 0;
  char s;
  scanf("%d", &n);
  scanf("%s", c);
  t = strlen(c);
  for (i = n; i < t; i += n) {
    if (c[i - 1] == c[i - 2] && c[i - 1] == c[i - 3])
      sum++;
    else
      continue;
  }
  printf("%d", sum);
  return 0;
}
