#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  string game = "";
  cin >> n;
  cin >> game;
  int count = 0;
  for (int i = n; i < game.length(); i += n) {
    if ((game.at(i - 1) == game.at(i - 2)) &&
        (game.at(i - 2) == game.at(i - 3))) {
      count++;
    }
  }
  cout << count;
  return 0;
}
