#include <bits/stdc++.h>
using namespace std;
int read(){
	int sum=0,f=1;
	char s=getchar();
	while (s<'0' or s>'9'){
		if (s=='-')f=-1;
		s=getchar();
	}
	while (s>='0' and s<='9'){
		sum=sum*10+s-'0';
		s=getchar();
	}
	return sum*f;
}
stack<char>s;
int main(){
	int n=read();
	string s1;
	cin>>s1;
	int ans=n;
	for (int i=0;i<n;i++){
		s.push(s1[i]);
		while (s.size()>=3 and s.top()=='x'){
			s.pop();
			if (s.top()!='o'){
				s.push('x');
				break;
			}
			s.pop();
			if (s.top()!='f'){
				s.push('o');
				s.push('x');
				break;
			}
			s.pop();
			ans-=3;
		}
	}
	cout<<ans<<endl;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll n; cin >> n;
    string s; cin >> s;
    vector<char>v;
    for(ll i = 0; i < n; i++) {
        v.push_back(s[i]);
        if(v.size() >= 3) {
            if(v[v.size() - 1] == 'x' && v[v.size() - 2] == 'o' && v[v.size() - 3] == 'f') {
                ll g = 3;
                while(g--) v.pop_back();
            }
        }
    }

    cout << v.size() << endl;
    return 0;
}
