import sys





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    a = int(readline())

    b = int(readline())

    for i in range(1, 4):

        if a != i and b != i:

            print(i)

            exit()





if __name__ == '__main__':

    solve()

import sys





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    a = int(readline())

    b = int(readline())

    print((1 ^ 2 ^ 3 ^ a ^ b))





if __name__ == '__main__':

    solve()

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    a = int(readline())
    b = int(readline())
    for i in range(1, 4):
        if a != i and b != i:
            print(i)
            exit()


if __name__ == "__main__":
    solve()

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    a = int(readline())
    b = int(readline())
    print((1 ^ 2 ^ 3 ^ a ^ b))


if __name__ == "__main__":
    solve()

-    for i in range(1, 4): -        if a != i and b != i: -            print(i) -            exit() +    print((1 ^ 2 ^ 3 ^ a ^ b))