#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int l = s.length();
  int i = 0, count = 0;
  for (i = n; i < l; i += n) {
    if (s[i - 1] == s[i - 2] && s[i - 2] == s[i - 3]) count++;
  }
  printf("%d\n", count);
  return 0;
}
