#include <bits/stdc++.h>
using namespace std;
template<class C>constexpr int sz(const C&c){return int(c.size());}
using ll=long long;using ld=long double;constexpr const char nl='\n',sp=' ';

int main() {
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
  // freopen("err.txt", "w", stderr);
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  int N;
  string S;
  cin >> N >> S;
  string cur;
  for (char c : S) {
    cur.push_back(c);
    if (sz(cur) >= 3 && cur.substr(sz(cur) - 3) == "fox") {
      cur.pop_back();
      cur.pop_back();
      cur.pop_back();
    }
  }
  cout << sz(cur) << nl;
  return 0;
}

#include <bits/stdc++.h>
// #include<iomanip>
using namespace std;


#define int long long int
typedef pair<int, int> pii;
#define f(i,a,b) for(int i=a;i<b;i++)
#define fo(i,a,b) for(int i = a; i<=b;i+=1)
// #define Vector vector
#define rf(i,a,b)  for(int i=a;i>=b;i--)
#define vll vector<int>
#define sz(a) int(a.size())
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front 
#define MAXN 100010
#define MOD 1000000007
#define mod 998244353
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define debug(x) cout << '>' << #x << ':' << x << " ";
#define nl '\n'
#define MS(x,y) fill_n(*x, sizeof x / sizeof **x, y);
#define mem(x,y) memset(x,y,sizeof(x));
#define INF 1000000000000000000
#define IO                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);

void solve(){
    int n;
    cin >> n;
    string s;
    cin >> s;

    stack<char> stk;
    
    char prev = '*', prevprev = '*';

    for(int i = 0; i < n; i++){
        if(stk.empty()){
            stk.push(s[i]);
        }
        else {
            if(s[i] == 'x' and stk.size() >= 2){
                prev = stk.top();
                stk.pop();
                prevprev = stk.top();
                stk.pop();
                if(prev == 'o' and prevprev == 'f'){

                }
                else {
                    stk.push(prevprev);
                    stk.push(prev);
                    stk.push(s[i]);
                }
            }
            else {
                stk.push(s[i]);
            }
        }
    }
    cout << stk.size() << nl;
    return ;
}
main()
{
    IO;
    int T = 1;
    // cin >> T;
    for(int c=1; c <= T; c++){
        solve();
        // cout<<"Case #"<<c<<": ";
    }
    return 0;
}