N = int(input()) a = [int(i) for i in input().split()] if a.__len__() > 2: print(str("assert")) else: for i in range(2): a.append(int(input())) b = [sum(a)-p for p in a] b.sort() print(b[1])