#include <bits/stdc++.h>
char action[2005];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", action);
  int len = strlen(action);
  int cnt = 0;
  for (int i = n; i < len; i += n) {
    if (action[i - 1] == action[i - 2] && action[i - 2] == action[i - 3]) cnt++;
  }
  printf("%d\n", cnt);
}
