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