function main(input){
    input = input.split('\n');
    inputA = parseInt(input[0]);
    inputB =  parseInt(input[1]);

    console.log(6/(inputA*inputB));
}

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