import sys



a = int(eval(input()))

b = int(eval(input()))



numbers = [1, 2, 3]



for i in numbers:

  if i != a and i != b:

    print(i)

    sys.exit()

import sys



a = int(eval(input()))

b = int(eval(input()))



print((6 - a - b))
import sys

a = int(eval(input()))
b = int(eval(input()))
numbers = [1, 2, 3]
for i in numbers:
    if i != a and i != b:
        print(i)
        sys.exit()

import sys

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

-numbers = [1, 2, 3] -for i in numbers: -    if i != a and i != b: -        print(i) -        sys.exit() +print((6 - a - b))