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