//Solution By SlavicG
#include "bits/stdc++.h"
 
using namespace std;
 
#define              ll              long long
 
#define       forn(i,n)              for(int i=0;i<n;i++)
#define          all(v)              v.begin(), v.end()
#define         rall(v)              v.rbegin(),v.rend()
 
#define            pb                push_back
#define          sz(a)               (int)a.size()
#define         fastio               ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

void solve()
{
	vector<char> v;
	int n;
	string s;
	cin >> n >> s;
	int cnt =0 ;
	for(int i= 0;i < n;i++)
	{
		v.pb(s[i]);
		if(sz(v) < 3)continue;
		string k = "";
		k += v[sz(v) - 3];
		k+= v[sz(v) - 2];
		k+= v[sz(v) - 1];
		if( k== "fox"){
			v.pop_back();
			v.pop_back();
			v.pop_back();
			cnt+=3;
		}
	}
	cout << n - cnt;
	//
}
 
int32_t main()
{
    fastio;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
#include <bits/stdc++.h>
#include <ctime>

using namespace std;
using ll=long long;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define cps CLOCKS_PER_SEC
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define cset(x) cout<<fixed<<setprecision(x)

int st=0;
string S;
int h=0;
int ti;
void snu(string &S,int &h){
    if((clock()-ti)>196*cps/100){
      st=0;
      return;
    }
    int k=S.size();
    stack<int> l;
    bool a=true;
    if(k<=2){
        st=k;
        return;
    }
    else{
        for(int i=h;i<k-2;i++){
            
            if(S[i]=='f'&&S[i+1]=='o'&&S[i+2]=='x'){
                if(k<=5){
                    st=k-3;
                    return;
                }
                else{
                    l.push(i);
                    if(a){
                        h=max(0,i-2);
                        a=false;
                    }
                }
            }
        }
    }
    while(!l.empty()){
        int x=l.top();
        l.pop();
        S.erase(x,3);
    } 
    if(a){
        st=S.size();
        return;
    }
    else{
        snu(S,h);
        return;
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int ti=clock();
    int n;
    
    cin>>n>>S;
 
    snu(S,h);
    cout<<st<<"\n";
}