#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
const int maxn = 1000000;
int main() {
  int n;
  string f;
  cin >> n;
  cin >> f;
  int len = f.size();
  int ans = 0;
  for (int i = n; i < len; i += n)
    if (f[i - 1] == f[i - 2] && f[i - 2] == f[i - 3]) ans++;
  printf("%d\n", ans);
  return 0;
}
