#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
//# define int int64_t
#define pb push_back
//std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); //used to take input a line after taking input a variable
//#define first fi
//#define second se
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll mod = 1e9 + 7,mxn=5e5 + 5;

signed main(){
    gok

   int n;
   cin>>n;
   string s;
   cin>>s;

   stack<char> st;
   int an=0;
   for(int i=0;i<=n;i++)
   {
       if(st.size()<3&&i<n)
       {
           st.push(s[i]);
       }
       else if(st.size()>=3)
       {
           char c = st.top();
           st.pop();
           char b = st.top();
           st.pop();
           char a = st.top();
           st.pop();
           //cout<<a<<" "<<b<<" "<<c<<endl;
           if(a=='f'&&b=='o'&&c=='x')
            an+=3;
           else
           {
               st.push(a);
               st.push(b);
               st.push(c);
           }
           if(i<n)
            st.push(s[i]);
       }
   }
   cout<<n-an;







      return 0;
    }


/**    Fucc 😕
	-  doanphuc : /
	* author: doanphuc. *
**/
#include <bits/stdc++.h>
#define TASK ""
#define inpf freopen(TASK".inp", "r", stdin)
#define outf freopen(TASK".out", "w", stdout)
template<class T> T gcd(T a, T b) { T r; while (b != 0) { r = a % b; a = b; b = r; } return a; }
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define FOR(i,x,y) for(int i = x; i <= y ; i ++)
#define FORT(i,x,y) for(int i = x; i < y ; i ++)
#define FORD(i,x,y) for(int i = x; i >= y ; i --)
#define clean(x) memset(x, 0, sizeof(x))
#define F first
#define S second
#define maxn 100005
#define MOD 1000000007
#define pii pair<int,int>
#define ll long long
#define db double
#define mp make_pair
#define pb push_back
#define yes cout << "YES" << "\n"
#define no  cout << "NO" << "\n"
#define ct(x) cout << x << endl
#define bit(p,x) ((x>>p) & 1)
#define all(x) (x).begin(), (x).end()
#define resized(x) (x).resize(unique(all(x)) - (x).begin())
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
ll m, n, k, t, dem = 0, ans = 0 ;
string s ;
int main()
{
    cin >> n >> s ;
    for(int i = 0; i < n; i ++)
    {
        if(s[i] == 'f' && s[i + 1] == 'o' && s[i + 2] == 'x' && i + 1 < n && i + 2 < n)
        {
            s.erase(i, 3) ;
            i = max(-1, i - 3) ;
//            i = i - 2 ;
        }
    }
//    cout << s << endl;
    cout << s.length() ;

}
