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

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

	int a, b;
	int x = 1^2;
	cin >> a >> b;
	if ((x^a^b) != (1^2)) cout << (x^a^b);
	else cout << a;		

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {

    int x, y;
    cin >> x >> y;
    if ( x == y ) cout << x;
    else {
        int arr[3] = {0, 1, 2};
        for ( int i = 0; i < 3; i ++ ) {
            if ( arr[i] != x && arr[i] != y ) {
                cout << arr[i];
                break;
            }
        }
    }

}
