def solve(): n = int(input()) a = input() if " " in a: return "assert" a = int(a) b = int(input()) c = int(input()) ans = sorted(set([a + b, a + c, b + c]))[::-1] return ans[1] print(solve())