# No.851 テストケース n = int(input()) a = [] tmp = input() if tmp.count(' ') > 0: print('\"assert\"') else: a.append(int(tmp)) for i in range(1, n): a.append(int(input())) total_twos = [a[0] + a[1], a[1] + a[2], a[2] + a[0]] if total_twos.count(max(total_twos)) > 1: print(min(total_twos)) elif total_twos.count(min(total_twos)) > 1: print(min(total_twos)) else: for j in total_twos: if j != min(total_twos) and j != max(total_twos): print(j) break