/*
    Author: Anas
    Date:   17-09-2024
    Time:   14:07:22
    File:   B_Three_Brothers.cpp
*/
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
 
    ll t = 1;
    // cin >> t;
 
    auto Anas = [&]()
    {
        ll a, b;
        cin >> a >> b;
        vector<pair<ll, bool>> v = {{1, false}, {2, false}, {3, false}};
        for (ll i = 0; i < 3; i++)
        {
            if (a == v[i].first)
            {
                v[i].second = true;
            }
            if (b == v[i].first)
            {
                v[i].second = true;
            }
        }
        for (ll i = 0; i < 3; i++)
        {
            if (v[i].second == false)
            {
                cout << v[i].first;
                break;
            }
        }
    };
 
    while (t--)
    {
        Anas();
    }
 
    return 0;
}