#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
void umax(int &a, int b) { a = max(a, b); }
void umin(int &a, int b) { a = min(a, b); }
void file() { freopen("a.in", "r", stdin); }
namespace Solver {
int n;
string str;
void solve() {
  cin >> n >> str;
  int ans = 0;
  for (int i = n; i < str.size(); i += n) {
    ans += (str[i - 1] == str[i - 2] && str[i - 2] == str[i - 3]);
  }
  cout << ans;
}
};  // namespace Solver
int main() {
  Solver::solve();
  return 0;
}
