//---Vaidik Patel---//
//-------------------Proud to be Indian--------------------------------//
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set,multi multimap, map etc.
#include<ext/pb_ds/tree_policy.hpp> // include the tree_order_statistics_node update
using namespace __gnu_pbds;
#define int long long int
#define ld long double
#define pii pair<int,int>
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // find_by_order()
#define deb1(x) cout<<#x<<" : "<<x<<"\n";
#define deb2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<"\n";
#define deb3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<"\n";
#define deb4(x,y,z,w) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<"\t"<<#w<<" : "<<w<<endl;
#define deb5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl;
#define deb6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rFOR(i,a,b) for(int i=a;i>=b;i--)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define vvi vector<vector<int>>
#define M 998244353
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int powermodm(int x,int n,int m)
{int ans=1;   while(n){if(n&1){ans=(ans*x)%m;}x=(x*x)%m;n=n>>1;}return ans;}


void solve()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    stack<char>st;

    FOR(i,0,n)
    {
        if(i<2)
        {
            st.push(s[i]);
        }
        else
        {
            if(s[i]=='x' && st.size()>=2)
            {
                char y=st.top();
                st.pop();
                char x=st.top();
                st.pop();
                if(x=='f' && y=='o')
                {

                }
                else
                {
                    st.push(x);
                    st.push(y);
                    st.push(s[i]);
                }

            }
            else
            {
                st.push(s[i]);
            }
        }
    }
    cout<<st.size()<<"\n";
}
signed main()
{
    
    FIO

    int t;
    t=1;
    //cin>>t;
    FOR(i,0,t)
    {
        //cout<<"Case #"<<i+1<<": ";
        solve();
    }
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define u unsigned
#define ull unsigned long long
#define ld long double
#define pb push_back
#define fasterInOut ios::sync_with_stdio(false); cin.tie(0);
#define pi acos(-1)
#define f(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,a,b) for(int i=(a);i>=(b);i--)
#define MAX 1000000

void function(int x);

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("C:/Users/ASUS/Desktop/inout/input.txt", "r", stdin);
    freopen("C:/Users/ASUS/Desktop/inout/output.txt", "w", stdout);
    #endif

    int a,b,c;
    cin>>a>>b>>c;
    if((a+b)>=(b+c) && (a+b)>=(a+c))
    	cout<<a+b<<endl;
    else if((b+c)>=(a+b) && (b+c)>=(a+c))
    	cout<<b+c<<endl;
    else if((a+c)>(a+b) && (a+c)>(b+c))
    	cout<<a+c<<endl;
    
    return 0;
}