def main():

    A = [False]*5

    B = [int(i) for i in input().split()]

    for b in B:

        if b == 0:

            continue

        A[b-1] = True

    for i, a in enumerate(A):

        if not a:

            print((i+1))





if __name__ == '__main__':

    main()

def main():

    A = [int(i) for i in input().split()]

    B = [False]*5



    for a in A:

        if a == 0:

            continue

        B[a-1] = True



    for i, b in enumerate(B):

        if not b:

            print((i+1))

            break





if __name__ == '__main__':

    main()

def main():
    A = [False] * 5
    B = [int(i) for i in input().split()]
    for b in B:
        if b == 0:
            continue
        A[b - 1] = True
    for i, a in enumerate(A):
        if not a:
            print((i + 1))


if __name__ == "__main__":
    main()

def main():
    A = [int(i) for i in input().split()]
    B = [False] * 5
    for a in A:
        if a == 0:
            continue
        B[a - 1] = True
    for i, b in enumerate(B):
        if not b:
            print((i + 1))
            break


if __name__ == "__main__":
    main()

-    A = [False] * 5 -    B = [int(i) for i in input().split()] -    for b in B: -        if b == 0: +    A = [int(i) for i in input().split()] +    B = [False] * 5 +    for a in A: +        if a == 0: -        A[b - 1] = True -    for i, a in enumerate(A): -        if not a: +        B[a - 1] = True +    for i, b in enumerate(B): +        if not b: +            break