#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define Test int T;cin>>T;while(T--)
#define ls lower_bound
#define up upper_bound
#define bs binary_search
#define S second
#define F first
#define vi vector<int>  
#define pii pair<int,int>
#define vpii vector<pii>
#define vvi vector<vi>
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define m_n(v) *min_element(all(v))
#define m_x(v) *max_element(all(v))
#define _(a) for(auto &i:a)
#define nl cout<<"\n";
#define momo(k) memset(k,0,sizeof(k))
#define momi(k) memset(k,-1,sizeof(k))
// #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds;
// typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>indexed_set;

int power(int x, int y,int mod){
    int res = 1;
    while (y){
        if (y & 1)
        res = (res*x)%mod;
        y = y>>1;
        x = (x*x)%mod;
    }
    return res;
}
int modInverse(int a, int m){
    int m0 = m;
    int y = 0, x = 1;
    if (m == 1)  return 0;
    while (a > 1){
        int q = a / m;
        int t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0) x += m0;
    return x;
}
int binomial(int n,int k){
    int res = 1;
    if ( k > n - k ) k = n - k;
    for (int i = 0; i < k; ++i){
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

// vector<int> prime;
// void sieve(){
//     bool arr[30000]={0};
//     prime.pb(2);
//     for(int i=3;i<30000;i+=2){
//         if(arr[i])continue;
//         for(int j=i*i;j<30000;j+=i) arr[j]=1;
//         prime.pb(i);
//     }
// }
// const int N=1e18+2;
const int mod = 998244353;
const int N = 2e5+9; 

void doper(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}

int32_t main(){
    // doper();
    IOS;
    int n;
    cin>>n;
    string s;
    cin>>s;
    stack<char> st;
    for(auto i:s){
        if(i == 'x' and st.size()>0){
            if(st.top() == 'o' and st.size()>1){
                bool flag = 0;
                st.pop();
                if(st.top() == 'f' ) {
                    st.pop();
                    flag = 1;
                }
                if(flag == 0){
                    st.push('o');
                    st.push(i);
                }
            }else st.push(i);
        }else st.push(i);
    }
    cout<<st.size();
    // while(!st.empty()){
    //     cout<<st.top();nl;
    //     st.pop();
    // }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define d(x) cout<<x<<" "
#define nl cout<<endl
#define rep(var,init_val,final_val) for(int var = init_val; var < final_val; ++var)
#define tt ll t;cin>>t;while(t--)
#define show(a,b) rep(i,0,b) d(a[i]);nl;
#define mod 1000000007
#define vi vector<int>
#define pii pair<int,int>
const int d4i[] = {-1,0,1,0};
const int d4j[] = {0,1,0,-1};

const int d8i[] = {-1,-1,-1,0,1,1,1,0};
const int d8j[] = {-1,0,1,1,1,0,-1,-1};
// #define ONLINE_JUDGE true

void solve(){
	//cout<<"HELLO\n";
	int n;
	string s ,ans;
	cin>>n>>s;
	ans=s;
	int j = 0;
	rep(i,0,n){
		//cout<<i<<endl;
		ans[j]=s[i];
		j++;
		if(j<3) continue;
		if(ans.substr(j-3,3)=="fox") j-=3;
		//cout<<ans<<" "<<j<<endl;
		

	}
	cout<<j<<endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
	return 0;
}
