function main(input) {
  var input = input.trim().split(" ");
  var choice = [ "1", "2", "3"];
  var a = input[0];
  var b = input[1];
  var idx1 = choice.indexOf(a);
  var idx2 = choice.indexOf(b);
  choice.splice(idx2, 1);
  choice.splice(idx1, 1);
  return choice[0];
}
console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));