a = int(eval(input()))

b = int(eval(input()))

print((6-a-b))
def solve():

    a=int(eval(input()))

    b=int(eval(input()))

    print((6-a-b))

if __name__ == "__main__":

    solve()
a = int(eval(input()))
b = int(eval(input()))
print((6 - a - b))

def solve():
    a = int(eval(input()))
    b = int(eval(input()))
    print((6 - a - b))


if __name__ == "__main__":
    solve()

-a = int(eval(input())) -b = int(eval(input())) -print((6 - a - b)) +def solve(): +    a = int(eval(input())) +    b = int(eval(input())) +    print((6 - a - b)) + + +if __name__ == "__main__": +    solve()