N=int(input()) try: A=[int(input()) for _ in range(N)] a=A[0]+A[1] b=A[0]+A[2] c=A[1]+A[2] AA=sorted([a,b,c]) if b!=c: print(AA[1]) else: print(AA[0]) except: print("assert")