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