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