#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0;
  char x[2001];
  cin >> n;
  cin >> x;
  for (int i = n; i < strlen(x); i += n) {
    if (x[i - 1] == x[i - 2] && x[i - 2] == x[i - 3]) t++;
  }
  cout << t;
  return 0;
}
