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