//void __(){
//    string tmp;
//    _(int,n);
//    _(string,s);
//    for(char c : s){
//        if(sz(tmp) >= 2 && tmp.substr(sz(tmp)-2) == "fo" && c == 'x'){
//            tmp.pop_back();
//            tmp.pop_back();
//        }
//        else
//            tmp.pb(c);
//    }
//    print(sz(tmp));
//}
//
#include <iomanip>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
struct _print {
    string sep,end;
    bool space;
    ostream &stream;
    _print(string _sep=" ",string _end="\n",
            ostream &_stream = cout) 
        : sep(_sep),end(_end),space(false),
            stream(_stream) {}
    ~_print() { stream << end; }

    template <typename T>
        _print &operator , (const T &t) {
            if (space) stream << sep;
            space = true;
            stream << t;
            return *this;
        }
};
#define print _print(),
#define INPUT_WITHOUT_INIT(type,name) type name; cin >> name
#define GET_INPUT_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define _(...) GET_INPUT_MACRO(__VA_ARGS__,_IWI,_IWI,_IWI,_IWI,_IWI,_IWI,INPUT_WITHOUT_INIT)(__VA_ARGS__)
void __(){
    string tmp;
    _(int,n);
    _(string,s);
    for(char c : s){
        if(sz(tmp) >= 2 && tmp.substr(sz(tmp)-2) == "fo" && c == 'x'){
            tmp.pop_back();
            tmp.pop_back();
        }
        else
            tmp.pb(c);
    }
    print(sz(tmp));
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        __();
}


#include<iostream>
#include<vector>
using namespace std;
int main(){
	int N,len,ans=0;
	string S;
	vector<char> vec;
	cin>>N>>S;
	for(int i=0;i<N;i++){
		vec.push_back(S[i]);
		while(true){
			len = vec.size();
			if(len>=3 && vec[len-1]=='x' && vec[len-2]=='o' && vec[len-3]=='f'){
				vec.pop_back();
				vec.pop_back();
				vec.pop_back();
				ans++;
			}else break;
		}
	}
	cout<<N-3*ans;
	return 0;
}
