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