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