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