'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let A = parseInt(input[0]);
  let B = parseInt(input[1]);
  // console.log({ A, B });
  console.log(6 - A - B);


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