#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d\n", &n);
  int t = 0;
  string a;
  cin >> a;
  int ans = 0;
  for (int i = n; i < a.length(); i += n)
    if (a[i - 1] == a[i - 2] && a[i - 2] == a[i - 3]) ++ans;
  printf("%d", ans);
  return 0;
}
