#include <bits/stdc++.h>
using namespace std;
int counMinCharToBeRemoved(string str) {
  int res = 0, len = str.length();
  for (int i = 0; i < len; i++) {
    int count = 0;
    while (str[i] == 'x') {
      count++;
      i++;
    }
    res += count >= 3 ? count - 2 : 0;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  cout << counMinCharToBeRemoved(str) << endl;
}
