'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let A = parseInt(input[0]);
  let B = parseInt(input[1]);
  let Ans = 0;
  if (A !== 1 && B !== 1) {
    Ans = 1;
  } else if (A !== 2 && B !== 2) {
    Ans = 2;   
  } else {
    Ans = 3;   
  }

  console.log(Ans);

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
