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