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