#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n;
char seq[2005];
int main() {
  scanf("%d%s", &n, seq);
  int m = strlen(seq);
  int res = 0;
  for (int i = n; i < m; i += n) {
    if (seq[i - 3] == seq[i - 2] && seq[i - 2] == seq[i - 1]) ++res;
  }
  printf("%d\n", res);
  return 0;
}
