n = int(input()) a = [] for i in range(n): tmp = input() if " " in tmp: print("assert") print() exit() a.append(int(tmp)) li = [0]*3 li[0] = a[0]+a[1] li[1] = a[0]+a[2] li[2] = a[1]+a[2] li = set(li) li = list(li) li.sort(reverse=True) print(li[1])