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