#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c;
  char a[10000];
  while (~scanf("%d", &n)) {
    c = 0;
    cin >> a;
    for (int i = 4; a[i] != '\0'; i++)
      if (i % n == 0 && a[i - 1] == a[i - 2] && a[i - 2] == a[i - 3]) c++;
    cout << c << endl;
  }
  return 0;
}
