#include <bits/stdc++.h>
char A[2001];
using namespace std;
int main() {
  int n, l, c = 0;
  scanf("%d", &n);
  scanf("%s", A);
  l = strlen(A);
  for (int i = n; i < l; i += n)
    if (A[i - 1] == A[i - 2] && A[i - 2] == A[i - 3]) c++;
  printf("%d\n", c);
  return 0;
}
