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