#include <bits/stdc++.h>

using namespace std;

#define il inline
#define re register
#define Rep(i, s, e) for (re int i = s; i <= e; ++i)
#define Dep(i, s, e) for (re int i = s; i >= e; --i)
#define file(a) freopen(#a".in", "r", stdin), freopen(#a".out", "w", stdout)

const int N = 200010;

il int read() {
    int x = 0; bool f = true; char c = getchar();
    while (!isdigit(c)) {if (c == '-') f = false; c = getchar();}
    while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
    return f ? x : -x;
}

int n; char s[N];
int st[N], top;

int main() {
    n = read(), scanf("%s", s + 1);
    Rep(i, 1, n) {
        st[++top] = s[i];
        if (top >= 3 && st[top] == 'x' && st[top - 1] == 'o' && st[top - 2] == 'f') top -= 3;
    }
    printf("%d", top);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define vec vector<int>
#define vecp vector<pair<int,int>>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fi first
#define se second
#define fr1(i,a,b) for(int i=a;i<b;i++)
#define fr2(i,a,b) for(int i=a;i>=b;i--)
#define fr3(i,a,b) for(int i=a;i<=b;i++)
#define umap unordered_map<int,int>
#define omap map<int,int>
#define uset unordered_set<int>
#define oset set<int>
#define pr pair<int,int>
#define endl "\n"
#define mod 1000000007
#define all(v) v.begin(),v.end()

void solve()
{
    int n;
    cin>>n;
    string S;
    cin>>S;
    fr1(i,0,n-2)
    {
        if(i+2<n)
        {
            string sub=S.substr(i,3);
        if(sub=="fox")
        {
            S.erase(i,3);
            if(i>2)
                i-=3;
            else
                i=-1;
            n=S.size();
        }
        }
        if(S.size()==0)
        {
            cout<<0<<endl;
            return ;
        }

    }
    cout<<S.size()<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin>>t;
    fr3(i,1,t){
        solve();
    }
}

