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