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