n = input() li = list(map(int,input().split())) if len(li) >= 2: print("\"assert\"") else : a = int(input()) b = int(input()) c = li[0] li = [a+b,b+c,c+a] li = sorted(list(set(li))) print(li[len(li)-2])