#include <bits/stdc++.h>
using namespace std;
const int N = 3000;
char s[N];
int main() {
  int n;
  cin >> n;
  cin >> s;
  int m = strlen(s);
  int cnt = 0;
  for (int i = n; i < m; i += n) {
    if (s[i - 3] == s[i - 2] && s[i - 2] == s[i - 1]) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
