#include <bits/stdc++.h>
using namespace std;
char line[2000];
int n;
bool iguales(int pos) {
  if (line[pos - 1] == line[pos - 2] && line[pos - 2] == line[pos - 3])
    return true;
  return false;
}
int main() {
  cin >> n >> line;
  int cant = 0;
  for (int i = 0; line[i]; i++) {
    if (i % (n) == 0 && i >= 3) {
      if (iguales(i)) cant++;
    }
  }
  cout << cant << endl;
  return 0;
}
