#include<bits/stdc++.h>
typedef long long LL;
using namespace std;

const int N=2e5+100;
int n,stk[N],top; char str[N];
int main() {
	scanf("%d%s",&n,str+1);
	for(int i=1;i<=n;++i) {
		if(top >= 2 && str[stk[top-1]] == 'f' && str[stk[top]] == 'o' && str[i] == 'x')
			top -= 2;
		else stk[++top]=i;
	}
	cout<<top;
	return 0;
}
#include<stdio.h>
#include<iostream>

int main() {
	int x;
	int y;
	int z;

	std::cin >> x;
	std::cin >> y;

	if(x==y){
		z = x;
	}
	else{
		z = 3 - x - y;
	}

	std::cout << z;
	return 0;
}