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