#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, len, ans = 0;
  string s;
  cin >> n >> s;
  len = s.length();
  s = ' ' + s;
  for (i = n + 1; i <= len; i += n) {
    for (j = i - 2; j < i; j++)
      if (s[j] != s[j - 1]) break;
    if (j == i) ans++;
  }
  cout << ans << endl;
  return 0;
}
