var print = this.print || require('lol-io').print; //print --> outputs result and adds (enter)
var write = this.write || require('lol-io').write; //write --> creates output.txt with output
var readline = this.readline || require('lol-io').readline; //readline --> reads unread line of input.txt

var a, b, arr;

a = Number(readline());
b = Number(readline());
arr = [a, b];


if (!arr.includes(1)) {
    print(1);
} else if (!arr.includes(2)) {
    print(2);
} else {
    print(3);
};
