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