'use strict';
const main = input => {
  let a = input[0], b = input[1];
  if (a!='1' && b!='1') console.log('1');
  if (a!='2' && b!='2') console.log('2');
  if (a!='3' && b!='3') console.log('3');
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));