N = int(input()) A = input() if ' ' in A: print('"assert"') A,B,C = int(A),int(input()),int(input()) L = sorted(list(set([A+B, B+C, C+A]))) print(L[-2])