#include <bits/stdc++.h>
const int INF = (int)1e9;
const int NINF = -(int)1e9;
const int mod = (int)1e9 + 7;
const double EPS = 1e-10;
const int M = 100005;
using namespace std;
template <class T>
T gcd(T a, T b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
template <class T>
T lcd(T a, T b) {
  return abs(a * b) / gcd(a, b);
}
void init() {}
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int cnt = 0;
  for (int i = n; i < str.length(); i = i + n) {
    if (str[i - 1] == str[i - 2] && str[i - 2] == str[i - 3]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
