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