#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int l = s.size(), ans = 0;
  if (l <= n) {
    printf("0");
    return 0;
  }
  int i = 0, j;
  for (i = n; i < l; i += n) {
    char c = s[i - 1];
    for (j = 1; j <= 3; j++) {
      if (c != s[i - j]) break;
    }
    if (j == 4) ans++;
  }
  printf("%d", ans);
  return 0;
}
