#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j = 0, n;
  string game;
  cin >> n >> game;
  for (i = n; i < int(game.size()); i += n)
    if (game[i - 1] == game[i - 2] && game[i - 2] == game[i - 3]) j++;
  cout << j << endl;
  return 0;
}
