import std.stdio, std.string, std.algorithm, std.array, std.range, std.conv,
    std.typecons, std.math, std.container, std.format;

void main(string[] args)
{
    int[] xs = [0, 0];
    readf("%d\n", &xs[0]);
    readf("%d\n", &xs[1]);

    if (xs.canFind(1) && xs.canFind(2))
    {
        writeln(3);
    }
    else if (xs.canFind(2) && xs.canFind(3))
    {
        writeln(1);
    }
    else
    {
        writeln(2);
    }
}
