#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k, count = 0;
  char str[2000];
  cin >> n >> str;
  for (i = n; i < strlen(str); i = i + n) {
    if (i >= strlen(str))
      break;
    else {
      char c = str[i - 1];
      if (str[i - 2] == c && str[i - 3] == c) count++;
    }
  }
  cout << count << endl;
  return 0;
}
