import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools N = int(readline()) data = readlines() if len(data) < 3: print('"assert"') exit() nums = list(map(int,data)) se = set(a+b for a,b in itertools.combinations(nums, 2)) answer = sorted(se, reverse=True)[1] print(answer)