#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int ignore;
	string inp;
	cin >> ignore >> inp;

	string stac;
	for (const auto& x : inp)
	{
		stac.push_back(x);
		while (stac.length() >= 3 && stac[stac.length() - 1] == 'x' &&\
		stac[stac.length() - 2] == 'o' && stac[stac.length() - 3] == 'f')
			stac.pop_back(), stac.pop_back(), stac.pop_back();
	}
	cout << stac.length() << "\n";

	return 0;
}
#include<iostream>
using namespace std;

int main() {
  int N,i;
  string s,t="";
  cin>>N>>s;

  for (i=0;i<N;i++) {
    t += s[i];
    if (t.size() >= 3 && t.substr(t.size()-3) == "fox") t = t.substr(0, t.size()-3);
  }

  cout<<t.size()<<endl;
  return 0;
}
