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