#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &o, vector<T> &vec) {
  for (auto &v : vec) o << v << ' ';
  return o;
}
const long long mod = 1e9 + 7;
const long long mxN = 1e2 + 1;
const long long inf = 1e4;
const char nl = '\n';
void solve() {
  long long n;
  string s;
  cin >> n >> s;
  long long cnt = 0, ans = 0;
  for (long long i = 0; s[i]; ++i) {
    if (s[i] == 'x')
      ++cnt;
    else {
      if (cnt >= 3) ans += (cnt - 2);
      cnt = 0;
    }
  }
  if (cnt >= 3) ans += (cnt - 2);
  cout << ans << nl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long tt = 1;
  while (tt--) solve();
  return 0;
}
