#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  scanf("%d ", &n);
  string str;
  getline(cin, str);
  vector<int> v(2);
  int r = 0;
  for (int i = n; i < str.size(); i += n)
    if (str[i - 1] == str[i - 2] && str[i - 1] == str[i - 3]) r++;
  printf("%d\n", r);
}
int main() {
  solve();
  return 0;
}
