n=int(input()) try: l=[int(input()) for i in range(n)] l=list(set([sum(l)-i for i in l])) l.sort() print(l[-2]) except: print('"assert"')