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