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