#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (ll)1e9 //10^9:∞
#define LLINF (ll)1e12
#define MOD (ll)(1e9+7) //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)
#define endl "\n"

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__

	int N;
	string S;
	cin>>N>>S;
	stack<int> stc;
	
	REP(i,N){
		if(stc.size()>=2 && S[i]=='x'){
			char oo=stc.top();stc.pop();
			char ff=stc.top();stc.pop();
			if(oo=='o' && ff=='f')continue;
			else {
				stc.push(oo);
				stc.push(ff);
				stc.push(S[i]);
			}
		}
		else stc.push(S[i]);
	}

	cout<<stc.size()<<endl;


	



	

		return 0;
}

#include <bits/stdc++.h>
std::string b,t="fox";int a,i;main(){for(std::cin>>a>>b;i<a-2;i++)if(b.substr(i,3)==t)b.erase(i,3),i=std::max(-1,i-3),a-=3;std::cout<<a;}
