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

int main() {
  int x,y;
  cin >> x >> y;
  if (x==y) cout << x << endl;
  else cout << 3-x-y << endl;
}

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

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

    int x, y;
    cin >> x >> y;
    int mov[3] = {0};
    mov[x]++; mov[y]++;
    if(x==y){
        cout << x << "\n";
    }
    else{
        for(int i=0; i<3; i++){
            if(!mov[i]) cout << i << "\n";
        }
    }
            
    return 0;
}