#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  char a[2500];
  cin >> a;
  for (int i = n; i < strlen(a); i += n)
    if (a[i - 1] == a[i - 2] && a[i - 2] == a[i - 3]) ans++;
  cout << ans;
  return 0;
}
