#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG //checks for container overflows
#pragma GCC optimize "trapv" //to chcek for int overflow
#pragma -Wduplicated-cond //dupilcate conditions
#endif
#include "bits/stdc++.h"
using namespace std;
using namespace chrono;
typedef unsigned long long int ull;
typedef long long ll;
#define F first
// #define S second
#define nl '\n'
#define de1(x) cerr << #x << ":" << x <<nl;
#define de2(x,y) cerr << #x << ":" << x << " " << #y << ":" << y << nl
#define de3(x,y,z) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<nl
#define de4(x,y,z,w) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#w<<": "<<w<<nl
#define all(x) x.begin(), x.end()
#define rt return 0;
#define vvi vector<vector<int>>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define um unordered_map<int,int>
const float pi = 3.14;
const ull mod = 1ll << 32;

void solve()
{
  stack<char> s;

  int n;
  string str;
  cin >> n >> str;
  if (n <= 3 && str != "fox")
  {
    cout << n;
    return;
  }

  register int cnt = 0, i;

  for (i = 0; i < n; i++)
  {
    if (str[i] == 'x' && s.size() && s.top() == 'o')
    {
      s.pop();
      if (s.size() && s.top() == 'f')
      {
        cnt += 3;
        s.pop();
        continue;
      }
      s.push('o');
      s.push('x');
    }

    else
      s.push(str[i]);
  }

  cout << n - cnt;

}

int main() {

#ifndef ONLINE_JUDGE
  auto start = high_resolution_clock::now();
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  fast

  solve();

#ifndef ONLINE_JUDGE
  auto end = high_resolution_clock::now();
  double time_taken = duration_cast<nanoseconds>(end - start).count();
  time_taken *= 1e-9;
  cerr << "Time : " << fixed << time_taken << setprecision(9) << nl;
#endif
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1<<30;
const ll inf_l = 1LL<<61;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    string t;
    rep(i,n) {
        t += s[i];
        int sz = t.size();
        if (sz - 3 >= 0 && t.substr(sz - 3, 3) == "fox") {
            rep(i,3) t.pop_back();
        }
    }
    int ans = t.size();
    cout << ans << endl;
}