[Image] 

As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. 

A famous sculptor Cicasso, whose self-portrait you can contemplate, hates cubism. He is more impressed by the idea to transmit two-dimensional objects through three-dimensional objects by using his magnificent sculptures. And his new project is connected with this. Cicasso wants to make a coat for the haters of anticubism. To do this, he wants to create a sculpture depicting a well-known geometric primitive — convex polygon.

Cicasso prepared for this a few blanks, which are rods with integer lengths, and now he wants to bring them together. The i-th rod is a segment of length l_{i}.

The sculptor plans to make a convex polygon with a nonzero area, using all rods he has as its sides. Each rod should be used as a side to its full length. It is forbidden to cut, break or bend rods. However, two sides may form a straight angle $180^{\circ}$.

Cicasso knows that it is impossible to make a convex polygon with a nonzero area out of the rods with the lengths which he had chosen. Cicasso does not want to leave the unused rods, so the sculptor decides to make another rod-blank with an integer length so that his problem is solvable. Of course, he wants to make it as short as possible, because the materials are expensive, and it is improper deed to spend money for nothing. 

Help sculptor! 


-----Input-----

The first line contains an integer n (3 ≤ n ≤ 10^5) — a number of rod-blanks.

The second line contains n integers l_{i} (1 ≤ l_{i} ≤ 10^9) — lengths of rods, which Cicasso already has. It is guaranteed that it is impossible to make a polygon with n vertices and nonzero area using the rods Cicasso already has.


-----Output-----

Print the only integer z — the minimum length of the rod, so that after adding it it can be possible to construct convex polygon with (n + 1) vertices and nonzero area from all of the rods.


-----Examples-----
Input
3
1 2 1

Output
1

Input
5
20 4 3 2 1

Output
11



-----Note-----

In the first example triangle with sides {1 + 1 = 2, 2, 1} can be formed from a set of lengths {1, 1, 1, 2}. 

In the second example you can make a triangle with lengths {20, 11, 4 + 3 + 2 + 1 = 10}.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
l = list(map(int, input().split()))

total = sum(l)

gap = 0
for rod in l:
    gap = max(gap, rod - (total - rod))

print(gap + 1)


kq = int(input())
luv = list(map(int,input().split(' ')))
luv.sort()
luv.reverse()
print(max(0, luv[0]-sum(luv[1:])+1))

#!/usr/bin/env python3

try:
    while True:
        n = int(input())
        a = list(map(int, input().split()))
        m = max(a)
        print((m << 1) - sum(a) + 1)

except EOFError:
    pass


n = int(input())
A = list(map(int, input().split()))

s = max(A)
t=sum(A) - s
print(s - t+1)

__author__ = 'Andrey'
n = int(input())
m, s1 = (lambda x : (max(x), sum(x)))(list(map(int, input().split())))
s = s1 - m
print(m - s + 1)

n = int(input())
sz = list(map(int, input().split()))
max_sz = max(sz)
print(2 * max_sz - sum(sz) + 1)

n = int(input())
A = [int(x) for x in input().split()]
print(2*max(A) - sum(A) + 1)


input()
arr = list(map(int, input().split()))
ans = 0
tmp = sum(arr)
for i in arr:
    if i*2 >= tmp:
        ans = 2*i-tmp+1
        break
print(ans)


3

n = int(input())
v = list(map(int, input().split()))

M = max(v)
v.remove(M)

print(M - sum(v) + 1)





n, l = int(input()), list(map(int, input().split()))
print(2 * max(l) - sum(l) + 1)

n = int(input())
s = [int(i) for i in input().split()]
a = max(s)
b = min(s)
c = sum(s)
print(a-b- (c-a-b)+1)


n=int(input())
l=sorted(map(int,input().split()))
print(l[-1]-sum(l[:-1])+1)

n = int(input())
xs = list(map(int, input().split()))

xs.sort(reverse=True)

a = xs[0]
b = xs[1]

for i in xs[2:]:
    if a + i - b > b + i - a:
        b += i
    else:
        a += i

print(abs(a - b) + 1)


def solve():
    N = int(input())
    L = list(map(int, input().split()))

    ma = max(L)

    re = sum(L) - ma

    ans = ma - re + 1

    print(ans)


def __starting_point():
    solve()

__starting_point()

n = int(input())
a = list(map(int, input().split()))

a.sort()

print(a[-1] - sum(a[:-1]) + 1)


__author__ = 'Utena'
n=int(input())
rods=sorted(list(map(int,input().split())))
total=sum(rods)
t=0
j=0
for i in range(n-1):
    t+=rods[i]
    if t>=total-t:j=1
if j==0:
    print(2*rods[-1]-total+1)
else:
    print(1)

n = input()
l = sorted(map(int, input().split()))
m = sum(l[:-1])
print(l[-1] + 1 - m)


n = int(input())
l = list(map(int, input().split()))

l.sort(reverse=True)

k = sum(l) / 3

ans = [0, 0, 0]
j = 0

for i in l:
    ans[j] += i
    if ans[j] >= k:
        j += 1

ans.sort(reverse=True)


print(ans[0] - ans[1] + 1 - ans[2])

n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
total = sum(l)
answer = 2*l[0] - total  +1
print(answer)


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
p = a[0]
q = sum(a[1:])
r = p - q + 1
print(r)



n=int(input())
d=input().split()
d=[int(x) for x in d ]
m=max(d)
d.remove(m)
S=0
for i in d:
    S+=i
print(m-S+1)


n = int(input())
arr = []
sum = 0
for x in input().split():
    arr.append(int(x))
    sum += int(x)

ln = 0
for i in range(0, len(arr)):
    if(ln<arr[i]):
        ln = arr[i]

sn = sum - ln

print(str(ln-sn+1))

import sys
import re

def main():
    a = int(input())
    b = input().split()
    bb = []
    for num in b:
        bb.append(int(num))
    b = bb
    b.sort()
    c = b.pop()
    d = 0
    for num in b:
        d += num
    e = c - d + 1
    print(e)
    return

main()


n = int(input())
a = list(map(int, input().split()))
m = max(a)
s = sum(a)-m
print(m-s+1)