#include <bits/stdc++.h>
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const long long maxn = 1e5 + 7;
const double pi = acos(-1);
const long long inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
using namespace std;
int n;
string str;
int ans;
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  cin >> str;
  int len = str.length();
  for (int i = n; i < len; i += n) {
    if (str[i - 1] == str[i - 2] && str[i - 2] == str[i - 3]) ans++;
  }
  cout << ans << '\n';
  return 0;
}
