#include <bits/stdc++.h>
typedef long long int lli;
typedef long double ldb;
 
#define endl '\n'
#define loop(i, m, n) for (lli i = m; i < n; i++)
#define loope(i, m, n) for (lli i = m; i <= n; i++)
#define ulta(i, m, n) for (lli i = m; i >= n; i--)
#define maxe *max_element
#define mine *min_element
#define plli pair<lli, lli>
#define mod 1000000007
#define mod2 998244353
#define vt vector<lli>
#define fi first
#define se second
#define pb push_back
#define umap unordered_map
#define mmap multimap
#define mp make_pair
#define inp1(a) cin >> a
#define inp2(a, b) cin >> a >> b
#define inp3(a, b, c) cin >> a >> b >> c
#define inp4(a, b, c, d) cin >> a >> b >> c >> d
#define inp5(a, b, c, d, e) cin >> a >> b >> c >> d >> e
#define inp6(a, b, c, d, e, f) cin >> a >> b >> c >> d >> e >> f
#define pr0() cout << " "
#define pr1(a) cout << a << " "
#define pr2(a, b) cout << a << " " << b
#define pr3(a, b, c) cout << a << " " << b << " " << c
#define pr4(a, b, c, d) cout << a << " " << b << " " << c << " " << d
#define emp emplace //used to push a pair etc..
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x, 0;
//especially for deque both sides dynamic
#define pf push_front
//list doubly linked lists can insert at mid. splice fn can be used
#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;
 
lli gcd(lli a, lli b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
 
lli lcm(lli a, lli b){
    return (a * b) / gcd(a, b);
}
 
lli fib(lli n){
    if (n == 0 || n == 1)
        return 1;
    else{
        lli arr[n + 1];
        arr[0] = 0;
        arr[1] = 1;
        for (lli i = 2; i <= n; i++){
            arr[i] = arr[i - 1] + arr[i - 2];
        }
        return arr[n];
    }
}
 
lli mpow(lli base, lli exp){
    base %= mod;
    lli result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((lli)result * base) % mod;
        base = ((lli)base * base) % mod;
        exp >>= 1;
    }
    return result;
}
 
lli is_prime(lli a){
    lli i;
    if (a == 2 || a == 3)
        return 1;
    else
        for (i = 2; i * i <= a; i++){
            if (a % i == 0)
                return 0;
        }
    return 1;
}
 
void swap(lli x, lli y){ //using XOR
    x ^= y;
    y ^= x;
    x ^= y;
}
 
lli digsum(lli n){
    return floor(log10(n)) + 1;
}
 
lli binsearch(lli arr[], lli l, lli r, lli no){
    while (l <= r){
        lli mid = (l + r) / 2;
        if (arr[mid] == no)
            return mid;
        else if (arr[mid] < no)
            l = mid + 1;
        else
            r = mid - 1;
    }
    return -1;
}
 
string sortString(string &str){
    lli i = 0, j = 0, k = 0;
    lli charCount[26] = {0};
    loop(i, 0, str.length())
        charCount[str[i] - 'a']++;
    loop(i, 0, 26){
        loop(j, 0, charCount[i]){
            str[k++] = char('a' + i);
        }
    }
    return str;
}

//sort(arr,arr+n,greater<lli>()) :: sorting array in reverse
 
int32_t main(){
    fast_io
    lli i = 0,j = 0;
    lli a,b;
    cin >> a >> b;
    if((a==1 && b==2) || (a==2 && b==1)) cout << 3;
    else if((a==2 && b==3) || (a==3 && b==2)) cout << 1;
    else cout << 2;
}

Measured memory_bytes: 256