#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, total = 0;
  string moves;
  cin >> n;
  cin >> moves;
  for (int i = n; i < moves.size(); i += n) {
    char current = moves[i - 1];
    bool valid = true;
    for (int j = 2; j < 4; j++) {
      valid = valid && current == moves[i - j];
    }
    if (valid) {
      total++;
    }
  }
  cout << total;
}
