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