#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, len, ans;
  char s[2005];
  scanf("%d", &n);
  scanf("%s", s);
  len = strlen(s);
  ans = 0;
  int j = n;
  while (j < len) {
    if (s[j - 1] == s[j - 2] && s[j - 1] == s[j - 3]) ans++;
    j += n;
  }
  printf("%d\n", ans);
  return 0;
}
