#include <bits/stdc++.h>
using namespace std;
bool vocala(char c) {
  if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' ||
      c == 'o' || c == 'O' || c == 'u' || c == 'U')
    return true;
  if (c == 'Y' || c == 'y') return true;
  return false;
}
int isprime(long long n) {
  if (n == 1) return 0;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return 0;
  return 1;
}
int isfibo(long long n) {
  long long a = 5 * n * n + 4;
  long long b = a - 8;
  if (sqrt(a) == int(sqrt(a)) || sqrt(b) == int(sqrt(b))) return 1;
  return 0;
}
int gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
ifstream in("input.txt");
ofstream out("output.txt");
long long const nrmax = 1e18;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  unsigned long long n, i, sum = 0, ans = 0;
  cin >> n >> s;
  for (i = 0; i < n; ++i) {
    if (s[i] == 'x')
      ++sum;
    else {
      if (sum > 2) {
        sum -= 2;
        ans += sum;
      }
      sum = 0;
    }
  }
  if (sum > 2) {
    sum -= 2;
    ans += sum;
  }
  cout << ans << '\n';
  in.close();
  out.close();
  return 0;
}
