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