#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0, c = 0;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == 'x') {
      ++c;
    } else {
      if (c >= 3) ans += c - 2;
      c = 0;
    }
  }
  if (c >= 3) ans += c - 2;
  cout << ans << endl;
}
