#include <iostream>

using namespace std;

typedef long long ll;

int main(){
    string S;
    ll a;
    scanf("%lld",&a);
    cin >> S;
    for (ll i=0; i<a-2; i++) {
        if (S[i]=='f' && S[i+1]=='o' && S[i+2]=='x') {
            S.erase(i, 3);
            i-=3;
        }
    }
    cout << S.size() << endl;
}
#include<bits/stdc++.h>
using namespace std;
typedef  long long int ll;
#include<string.h>
#define pi 3.1415926535897932384626433832795028841971
#define fastttt std::ios::sync_with_stdio(false);std::cin.tie(NULL);std::cout.tie(NULL);
#define str_max_len 4294967295
#define mod 1000000007
#define max_ll LLONG_MAX
#define min_ll LLONG_MIN
#define cps CLOCKS_PER_SEC
#define pb push_back
#define fi first
#define se second
#define in insert
#define m_p make_pair
#define p_q priority_queue
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define vii vector <pair<ll,ll>> 
#define pii pair<ll,ll>
#define vi vector <ll>
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);} 
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll maximum(ll a[],ll n)
{
	ll max1=min_ll;
	fo(i,n)
	{
		max1=max(max1,a[i]);
	}
	return max1;
}
ll minimum(ll a[],ll n)
{
	ll min1=max_ll;
	fo(i,n)
	{
		min1=min(min1,a[i]);
	}
	return min1;
}

ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
    if(y==0)return 1;
    ll a=power(x,y/2,m);
    if(y%2){
        return (a*((a*x)%m))%m;
    }
    else{
        return (a*a)%m;
    }
}
ll mod_inverse(ll x,ll m){
    return power(x,m-2,m);
}
ll fact(ll n,ll m){
    if(n<=1)return 1;
    return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
    if(r>n)return 0;
    ll n1=1,d1=1,d2=1;
    n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
    ll ans=mod_inverse((d1*d2)%m,m);
    ans=(ans*n1)%m;
    return ans;
}
ll gcd(ll a, ll b){ 
	if(a==0||b==0)return max(a,b);
    if (a < b)return gcd(b, a); 
    if (a % b == 0) return b; 
    return gcd(b,a % b);}

ll ispal(string s){
    ll len=s.size();
    ll flag=1;
    for(ll i=0;i<len;++i){
        if(s[i]!=s[len-i-1]){
            flag=0;break;
        }
    }
    return flag;
}

bool sortbysec(const pair<ll,ll> &a, 
              const pair<ll,ll> &b) 
{ 
    return (a.second < b.second); 
}  

    
/***************************code begins here*****************************/


class solver{
	public:
		
	void solve()
	{
		ll n;cin>>n;
		string s;cin>>s;ll ans=0;
		stack <char> st;
		if(n<=2)
		{
			cout<<n;return;
		}
		
		fo(i,n)
		{
			st.push(s[i]);
			//cout<<st.size()<<" ";
			if(st.size()>=3)
			{
				char a=st.top();st.pop();
				char b=st.top();st.pop();
				char c=st.top();st.pop();
				if(a=='x' && b=='o'&& c=='f')
				{
					n++;n--;
				}
				else
				{
					st.push(c);
					st.push(b);
					st.push(a);	
				}
				
			}
		}
		cout<<st.size();
	}
	
};
 
int main(){
	fastttt
	//	cout<<fixed<<setprecision(10);
	
	int test=1,c=1;
//	cin>>test;
	while(test--){
		//cout<<"Case #"<<c<<": ";c++;
		solver o;
		o.solve();
	}
}