#include "bits/stdc++.h"
using namespace std;

#define int long long
#define endl        "\n"
#define debug(arr) for(int x : arr) cout << x <<  " "; cout << endl;
#define fast        ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);


int32_t main() {
	fast;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int x, y;
	cin >> x >> y;

	if(x == y) {
		cout << x << endl;
	}else {
		cout << 3 - (x + y) << endl;
	}

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

int main()
{
    int x,y, rock=0, scissors=1, paper=2;
    cin>>x>>y;
    if(x==y) cout<<x;
    else{
        if(x==rock&&y==scissors || x==scissors&&y==rock) cout<<paper;
        else if(x==paper&&y==rock || x==rock&&y==paper) cout<<scissors;
        else cout<<rock;
    }
    return 0;
}