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