#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool flag = true, swap = false;
  int count = 0;
  while (flag) {
    swap = false;
    for (int i = 1; i < s.size() - 1; i++) {
      if (s[i] == 'x' && s[i - 1] == 'x' && s[i + 1] == 'x') {
        s.erase(i, 1);
        count++;
        swap = true;
      }
    }
    if (!swap) flag = false;
  }
  cout << count << endl;
  return 0;
}
