#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const double EPS = 1e-7;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = n; i < (int)s.length(); i += n) {
    bool equal = true;
    for (int j = 1; j <= 3; j++)
      if (s[i - j] != s[i - 1]) equal = false;
    if (equal) ans++;
  }
  cout << ans << endl;
  return 0;
}
