#include<bits/stdc++.h>
#define HohleFeuerwerke using namespace std
#pragma GCC optimize(3,"Ofast","-funroll-loops","-fdelete-null-pointer-checks")
#pragma GCC target("ssse3","sse3","sse2","sse","avx2","avx")
#define int long long
HohleFeuerwerke;
inline int read(){
	int s=0,f=1;char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) s=s*10+c-'0';
	return s*f;
}
inline void write(int x){
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar('0'+x%10);
}
signed main()
{
	int x=read();
	if(x>=0) write(x),puts("");
	else puts("0");
}
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  string S;
  cin >> N >> S;
  stack<char> st;
  int ans = N;
  for(int i = 0;i < N;i++){
    char c = S.at(i);
    if(c == 'f' || c == 'o')
      st.push(c);
    else if(c == 'x' && st.size() >= 2){
      char two = st.top();
      st.pop();
      char one = st.top();
      st.pop();
      if(one == 'f' && two == 'o')
        ans -= 3;
      else{
        for(;;){
          if(st.size() > 0) st.pop();
          else break;
        }
      }
    }
    else{
      for(;;){
        if(st.size() > 0) st.pop();
        else break;
      }
    }
  }
  cout << ans << endl;
}