
// Author: Muhesh Kumar

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using db = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;

using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvb = vector<vb>;

#define nl '\n'
#define fr first
#define sc second
#define bk back()
#define ft front()
#define pb push_back
#define ppb pop_back
#define lb lower_bound
#define ub upper_bound
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define sz(x) (int) (x).size()
#define amax(a, b) a = max(a, b)
#define amin(a, b) a = min(a, b)
#define trav(a, b) for(auto &a: b)
#define rep(i, a, b) for(int i = a; i < b; i++)

const ll inf = 1e18 + 10;
const db eps = 1e-9;
const int mod = 1e9 + 7;

ll modadd(ll a, ll b, ll m = mod) { a %= m; b %= m; return (((a + b) % m) + m) % m; }
ll modsub(ll a, ll b, ll m = mod) { a %= m; b %= m; return (((a - b) % m) + m) % m; }
ll modmul(ll a, ll b, ll m = mod) { a %= m; b %= m; return (((a * b) % m) + m) % m; }
ll gcd(ll a, ll b) { return __gcd(a, b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

template <typename T1, typename T2> 
inline std::ostream &operator << (std::ostream& os, const std::pair<T1, T2>& p) { 
    return os << "(" << p.first << ", " << p.second << ")"; 
} 

template<typename T> 
inline std::ostream &operator << (std::ostream& os,const std::vector<T>& v) { 
    bool first = true; 
    os << "["; 
    for(unsigned int i = 0; i < v.size(); i++) { 
        if(!first) 
            os << ", "; 
        os << v[i]; 
        first = false; 
    } 
    return os << "]"; 
} 

template<typename T> 
inline std::ostream &operator << (std::ostream& os,const std::vector<vector<T>>& v) { 
    bool first = true; 
    os << "[\n "; 
    for(unsigned int i = 0; i < v.size(); i++) { 
        if(!first) 
            os << ",\n "; 
        os << v[i]; 
        first = false; 
    } 
    return os << "\n]"; 
} 

template<typename T> 
inline std::ostream &operator << (std::ostream& os,const std::set<T>& v) { 
    bool first = true; 
    os << "["; 
    for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii) { 
        if(!first) 
            os << ", "; 
        os << *ii; 
        first = false; 
    } 
    return os << "]"; 
} 

template<typename T1, typename T2> 
inline std::ostream &operator << (std::ostream& os,const std::map<T1, T2>& v) { 
    bool first = true; 
    os << "[\n "; 
    for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii) { 
        if(!first) 
            os << ",\n "; 
        os << *ii ; 
        first = false; 
    } 
    return os << "\n]"; 
}

#ifndef ONLINE_JUDGE
    #define debug(a) cerr << #a << " " << a << '\n';
#else
    #define debug(a)
#endif

int main() {
 
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n; cin >> n; 
    string s; cin >> s;
    stack<char> st;

    trav (i, s) {
        st.push(i);
        if (sz(st) >= 3) {
            string t;

            int T = 3;
            while (T--) {
                t.pb(st.top());
                st.pop();
            }
            
            reverse(all(t));
            if (t != "fox") {
                trav (j, t) st.push(j);
            }
        } 
    }

    cout << sz(st);

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int n,t,i;
char s[200005],c[200005];
int main(){
    cin >>n;
    cin >>s;
    for(int i=0;i<n;i++)
        if(s[i]=='x'&&t>1&&c[t]=='o'&&c[t-1]=='f')
            t-=2;
        else
            c[++t]=s[i];
    cout <<t <<"\n";
    return 0;
}