import sys



a, b = list(map(int, sys.stdin.read().split()))



def main():

    ans = 6 - a - b

    return ans



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys



a = set(map(int, sys.stdin.read().split()))



def main():

    for i in range(1, 4):

        if not i in a:

            print(i)

            return



if __name__ ==  '__main__':

    main()
import sys

a, b = list(map(int, sys.stdin.read().split()))


def main():
    ans = 6 - a - b
    return ans


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys

a = set(map(int, sys.stdin.read().split()))


def main():
    for i in range(1, 4):
        if not i in a:
            print(i)
            return


if __name__ == "__main__":
    main()

-a, b = list(map(int, sys.stdin.read().split())) +a = set(map(int, sys.stdin.read().split())) -    ans = 6 - a - b -    return ans +    for i in range(1, 4): +        if not i in a: +            print(i) +            return -    ans = main() -    print(ans) +    main()