function Main(input) {
    var A = parseInt(input[0], 10);
    var B = parseInt(input[1], 10);

    var list = [1, 2, 3];
    var result = list.filter(n => n !== A && n !== B);

    console.log(result[0]);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));