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