#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdio>
#include<stdio.h>
#include<cmath>
#include<math.h>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<sstream>
#include<iomanip>
#define forn(i,n) for(int (i)=0;i<(n);i++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int MAXN=100005;
const int INF=2147483647;
const ll LINF=9223372036854775807;
const int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
int a,b;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>a>>b;
	if(a==b)cout<<a;
	else cout<<3-a-b;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long;    //个人习惯 
int main() 
{
	stack <char> fox;    //定义 
    int n;               //定义 
    string s;            //定义 
	cin >> n;            //输入 
	cin >> s;            //输入 
	for(int i = 0; i < s.length(); i++) 
	{
		if(fox.size() < 2)
		{
			fox.push(s[i]);
			continue;
		}
		char foox = fox.top();
	    fox.pop();
	    if(fox.top() == 'f' && foox == 'o' && s[i] == 'x')
	    {
		    fox.pop();     //弹出
		    continue; 
	    }
	    fox.push(foox);
	    fox.push(s[i]);
	}
	
	cout << fox.size();    //输出 
	return 0;
}