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