//Bismillahir Rahmanir Rahim
//Allahumma Rabbi Jhidni Elma
/*--------Please carefully check--------
    1.Overflow and underflow
    2.
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long  ull;
typedef long double ld;
const ld PI = 2*acosl(0.0);
const int inf=2e5+7;
const int mxN=3000000;
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define pb push_back
#define reset(a) memset(a,0,sizeof a)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (a/gcd(a,b)*b)
#define abs(a) (a<0?-(a):a)
#define debug1(x)  cout << #x << "=" << x << endl
#define debug2(x, y)  cout << #x << "=" << x << "," << #y << "=" << y << endl
#define digit2(x) floor((log2(x)))
#define digit2(x) floor((log2(x)))
#define sc(a) scanf("%d",&a)
#define pf(a) printf("%d\n",a)
int main()
{
    int i,n,j;
    string st,tmp;
    stack<char>stk;
    cin>>n;
    cin>>st;
   for(j=0,i=0;i<n;i++)
    {
        stk.push(st[i]);

        while(stk.size() and j<3)
        {
            tmp+=stk.top();
           // cout<<tmp<<endl;
            stk.pop();
            j++;
        }

        reverse(tmp.begin(),tmp.end());
        //cout<<tmp<<endl;
        if(tmp=="fox")
        {
            tmp.clear();
        }
        else
        {
            //cout<<"  ";
            for(j=0;j<(int)tmp.size();j++)
            {
               // cout<<tmp[j];
               stk.push(tmp[j]);
            }
            tmp.clear();
            //cout<<endl;
        }
            j=0;
       // cout<<tmp<<endl;

    }
    cout<<stk.size()<<endl;


       // cout<<n<<endl;

}


#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

using VI = vector <int>;
using SI = set<int>;

int main() {
    int N;
    string S;
    cin >> N >> S;

    SI remain;

    for (int i = 0; i < N; ++i) {
        remain.insert(i);
    }

    auto iter = remain.begin();
    while (iter != remain.end()) {
        VI now(3, *iter);
        auto iter2 = iter;
        ++iter2;

        if (iter2 != remain.end()) {
            now[1] = *iter2;

            auto iter3 = iter2;
            ++iter3;
            if (iter3 != remain.end()) {
                now[2] = *iter3;
            }
        }

        if (S[now[0]] == 'f' && S[now[1]] == 'o' && S[now[2]] == 'x') {
            int nextVal = -1;
            auto nextIter = iter;

            if (iter == remain.begin()) {
                ++nextIter;
                ++nextIter;
                ++nextIter;
            } else {
                --nextIter;
                if (nextIter != remain.begin()) {
                    --nextIter;
                }
            }

            if (nextIter != remain.end()) {
                nextVal = *nextIter;
            }

            // remove
            remain.erase(remain.find(now[0]));
            remain.erase(remain.find(now[1]));
            remain.erase(remain.find(now[2]));
            N -= 3;

            if (nextVal >= 0) {
                iter = remain.find(nextVal); // set can be dangling
            } else {
                break;
            }
        } else {
            ++iter;
        }
    }

    cout << N << endl;

    return 0;
}