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