#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::string input;
  std::cin >> input;
  int toRemove = 0, count = 0;
  auto max = [&](int a, int b) { return (a > b) ? a : b; };
  for (char c : input) {
    if (c == 'x')
      count++;
    else {
      toRemove += max(0, count - 2);
      count = 0;
    }
  }
  toRemove += max(0, count - 2);
  std::cout << toRemove << '\n';
  return 0;
}
