#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  size_t n;
  std::cin >> n;
  std::vector<char> a(n + 1);
  a[0] = 'a';
  std::vector<char> answer(2);
  std::cin >> answer[0] >> answer[1];
  char input;
  size_t j = 2;
  for (size_t i = 2; i != n; ++i) {
    std::cin >> input;
    if (input == 'x' && answer[j - 1] == 'x' && answer[j - 2] == 'x') {
    } else {
      answer.push_back(input);
      ++j;
    }
  }
  std::cout << n - answer.size() << '\n';
}
