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