Masha has three sticks of length $a$, $b$ and $c$ centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.

What is the minimum number of minutes she needs to spend increasing the stick's length in order to be able to assemble a triangle of positive area. Sticks should be used as triangle's sides (one stick for one side) and their endpoints should be located at triangle's vertices.


-----Input-----

The only line contains tree integers $a$, $b$ and $c$ ($1 \leq a, b, c \leq 100$) — the lengths of sticks Masha possesses.


-----Output-----

Print a single integer — the minimum number of minutes that Masha needs to spend in order to be able to make the triangle of positive area from her sticks.


-----Examples-----
Input
3 4 5

Output
0

Input
2 5 3

Output
1

Input
100 10 10

Output
81



-----Note-----

In the first example, Masha can make a triangle from the sticks without increasing the length of any of them.

In the second example, Masha can't make a triangle of positive area from the sticks she has at the beginning, but she can spend one minute to increase the length $2$ centimeter stick by one and after that form a triangle with sides $3$, $3$ and $5$ centimeters.

In the third example, Masha can take $33$ minutes to increase one of the $10$ centimeters sticks by $33$ centimeters, and after that take $48$ minutes to increase another $10$ centimeters stick by $48$ centimeters. This way she can form a triangle with lengths $43$, $58$ and $100$ centimeters in $81$ minutes. One can show that it is impossible to get a valid triangle faster.

Difficulty: EASY
Tags: Geometry

Mathematics

Complete search
Skill types: Complete search

Starter code:

Solutions:
(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
count = 0
if a + b > c and a + c > b and (b + c > a):
	print(count)
else:
	if a + b <= c:
		count += c - (a + b) + 1
	elif a + c <= b:
		count += b - (a + c) + 1
	elif b + c <= a:
		count = a - (b + c) + 1
	print(count)


a = list(map(int, input().split()))
a.sort()
if a[0] + a[1] > a[2]:
	print(0)
else:
	print(a[2] + 1 - (a[0] + a[1]))


(a, b, c) = list(map(int, input().split()))
pos1 = 0
pos2 = 0
pos3 = 0
if a + b <= c:
	pos1 = 1
if a + c <= b:
	pos2 = 1
if b + c <= a:
	pos3 = 1
if pos1 == 0 and pos2 == 0 and (pos3 == 0):
	print(0)
else:
	if pos1 == 1:
		pos1 = c - (a + b) + 1
	else:
		pos1 = 10000000000
	if pos2 == 1:
		pos2 = b - (a + c) + 1
	else:
		pos2 = 10000000000
	if pos3 == 1:
		pos3 = a - (b + c) + 1
	else:
		pos3 = 10000000000
	print(min(pos1, min(pos2, pos3)))


a = sorted(list(map(int, input().split())))
print(max(0, a[2] - a[1] - a[0] + 1))


import sys

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def next(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = sys.stdin.readline().split()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_int(self):
		return int(self.next())

	def solve(self):
		x = sorted([self.next_int() for _ in range(0, 3)])
		print(max(0, x[-1] - x[0] - x[1] + 1))
Main().solve()


def main():
	a = list(map(int, input().split()))
	a.sort()
	s = a[0] + a[1]
	if s > a[2]:
		print('0')
	else:
		print(a[2] + 1 - s)
main()


R = lambda : map(int, input().split())
(a, b, c) = sorted(R())
print(max(c - (a + b) + 1, 0))


sides = list(map(int, input().split()))
sides.sort()
ans = sides[2] - (sides[0] + sides[1])
if ans < 0:
	print(0)
else:
	print(ans + 1)


(a, b, c) = map(int, input().split())
if a + b <= c:
	print(-a - b + c + 1)
elif a + c <= b:
	print(-a - c + b + 1)
elif b + c <= a:
	print(a - (b + c) + 1)
else:
	print(0)


(a, b, c) = list(sorted(map(int, input().split())))
print(0 if a + b > c else c - (a + b) + 1)


lengths = list(map(int, input().split()))
lengths.sort()
time = lengths[2] + 1 - (lengths[0] + lengths[1])
if time < 0:
	print(0)
else:
	print(time)


list1 = sorted(list(map(int, input().split())))
(a, b, c) = (list1[0], list1[1], list1[2])
res = 0
while a + b <= c:
	a += 1
	res += 1
print(res)


import math

def go(a, b, c):
	(a, b, c) = sorted([a, b, c])
	if a + b > c:
		return 0
	else:
		return c + 1 - a - b
(a, b, c) = list(map(int, input().split()))
print(go(a, b, c))


lados = []
lados = list(map(int, input().split()))
lados.sort()
res = lados[2] - (lados[0] + lados[1]) + 1
if res > 0:
	print(res)
else:
	print(0)


(a, b, c) = map(int, input().split())
count = 0
if a + b > c and b + c > a and (c + a > b):
	print(count)
else:
	while (a + b > c and b + c > a and (c + a > b)) == False:
		if a <= b and a <= c:
			a += 1
			count += 1
		elif b <= a and b <= c:
			b += 1
			count += 1
		elif c <= b and c <= a:
			c += 1
			count += 1
	print(count)


s = input()
s = list(map(int, s.split()))
s.sort()
(a, b, c) = map(int, s)
res = 0
if a + b > c:
	print(res)
elif a + b <= c:
	print(c + 1 - (a + b))


from sys import stdin, stdout
(a, b, c) = [int(x) for x in stdin.readline().split()]
d = sorted([a, b, c])
if d[0] + d[1] > d[2]:
	print(0)
	quit()
print(d[2] - d[0] - d[1] + 1)


(a, b, c) = sorted([int(x) for x in input().split()])
print(max(0, c - a - b + 1))


abc = list(map(int, input().rstrip().split()))
abc.sort()
if abc[0] + abc[1] > abc[2]:
	print('0')
	exit()
elif abc[0] + abc[1] == abc[2]:
	print('1')
elif abc[0] + abc[1] < abc[2]:
	print(abc[2] - abc[0] - abc[1] + 1)


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


def mid(a, b, c):
	arr = [a, b, c]
	arr.sort()
	return arr[1]
(a, b, c) = map(int, input().split())
l = max(a, b, c)
m = min(a, b, c)
k = mid(a, b, c)
print(max(0, l - m - k + 1))


data = list(map(int, input().split()))
data.sort(reverse=True)
need = data[0] - (data[1] + data[2])
if need < 0:
	print(0)
else:
	print(need + 1)


a = [int(el) for el in input().split()]
a.sort()
if a[2] < a[1] + a[0]:
	print(0)
else:
	print(a[2] - a[1] - a[0] + 1)


(a, b, c) = map(int, input().split())
ans = 0
ans += max(0, a - (b + c) + 1)
ans += max(0, b - (a + c) + 1)
ans += max(0, c - (a + b) + 1)
print(ans)


n = list(map(int, input().split()))
if max(n) >= sum(n) - max(n):
	print(max(n) - (sum(n) - max(n)) + 1)
else:
	print(0)


li = list(sorted(map(int, input().split()), reverse=True))
a = li[0]
c = li[1] + li[2]
if c > a:
	print('0')
else:
	print(abs(c - a - 1))


arr = list(map(int, input().split()))
ans = 2 * max(arr) - sum(arr) + 1
print(ans if ans > 0 else 0)


(a, b, c) = map(int, input().split())
p = 0
while a + b <= c:
	if a >= b:
		b += 1
	else:
		a += 1
	p += 1
while a + c <= b:
	if a >= c:
		c += 1
	else:
		a += 1
	p += 1
while c + b <= a:
	if c >= b:
		b += 1
	else:
		c += 1
	p += 1
print(p)


sides = [int(x) for x in input().split(' ')]
differences = [sides[0] + sides[1] - sides[2], sides[2] + sides[0] - sides[1], sides[1] + sides[2] - sides[0]]
smallest = -1000
for dif in differences:
	if dif - 1 < 0 and dif - 1 > smallest:
		smallest = dif - 1
print(abs(smallest) if smallest != -1000 else 0)


al = input()
al = al.split()
a = int(al[0])
b = int(al[1])
c = int(al[2])
count = 0
s = True
while a + b <= c or b + c <= a or a + c <= b:
	if a + b <= c:
		if a + c > b:
			a += 1
		else:
			b += 1
		count += 1
	elif a + c <= b:
		if a + b > c:
			a += 1
		else:
			c += 1
		count += 1
	elif b + c <= a:
		if a + b > c:
			b += 1
		else:
			c += 1
		count += 1
print(count)


(a, b, c) = sorted(map(int, input().split()))
m = 0
while a + b <= c:
	m += 1
	b += 1
print(m)


a = list([int(s) for s in str(input()).strip().split(' ', 2)])
cnt = 0
a = sorted(a)
while a[0] + a[1] <= a[2]:
	a[1] += 1
	cnt += 1
print(cnt)


l = list(map(int, input().split()))
l.sort()
t = 0
if l[0] + l[1] > l[2]:
	t += 0
else:
	n = l[2] - (l[0] + l[1])
	t += n + 1
	l[0] += n // 2 + 1
	l[1] += n // 2
if l[0] + l[2] > l[1]:
	t += 0
else:
	n = l[1] - (l[0] + l[2])
	t += n + 1
	l[0] += n // 2 + 1
	l[2] += n // 2
if l[2] + l[1] > l[0]:
	t += 0
else:
	n = l[0] - (l[2] + l[1])
	t += n + 1
	l[1] += n // 2 + 1
	l[2] += n // 2
print(t)


(a, b, c) = [int(s) for s in input().split()]
su = a + b + c
ma = max(a, b, c)
print(max(0, 2 * ma - su + 1))


x = input()
x = x.split()
maxx = 0
sum = 0
for i in range(x.__len__()):
	x[i] = int(x[i])
	sum += x[i]
	if x[i] > maxx:
		maxx = x[i]
sum -= maxx
if sum > maxx:
	print(0)
else:
	print(maxx - sum + 1)


def solve():
	sides = [int(x) for x in input().split(' ')]
	count = 0
	for i in range(3):
		tmp = sides[:i] + sides[i + 1:]
		if sum(tmp) > sides[i]:
			continue
		else:
			count += sides[i] + 1 - sum(tmp)
	return count
print(solve())


a = list(map(int, input().split()))
l = max(a)
m = a.count(l)
if m == 1:
	r = list(filter(lambda x: x != l, a))
else:
	r = list(filter(lambda x: x != l, a))
	while m > 1:
		r.append(l)
		m -= 1
if l < sum(r):
	print(0)
else:
	y = l + 1
	s = y - sum(r)
	print(s)


ch = input()
a = int(ch.split()[0])
b = int(ch.split()[1])
c = int(ch.split()[2])
m = max(a, b, c)
if m == a:
	(c, a) = (a, c)
elif m == b:
	(c, b) = (b, c)
verif = False
i = 0
while verif == False:
	if c <= a + b - 1:
		verif = True
	else:
		a += 1
		i += 1
if verif == False:
	print(0)
else:
	print(i)


n = input().split()
a = int(n[0])
b = int(n[1])
c = int(n[2])
if a >= b + c:
	print(a - b - c + 1)
elif b >= a + c:
	print(b - a - c + 1)
elif c >= a + b:
	print(c - a - b + 1)
else:
	print(0)


(a, b, c) = map(int, input().split())
m = max(a, b, c)
s = a + b + c - m
if s > m:
	print(0)
else:
	print(m - s + 1)


arr = list(map(int, input().split()))
mx = max(arr)
arr.remove(mx)
print(0 if sum(arr) - mx > 0 else mx + 1 - sum(arr))


edges = list(map(int, input().split()))
edges.sort()
counter = 0
while True:
	if edges[0] + edges[1] > edges[2]:
		print(counter)
		break
	else:
		edges[0] += 1
		counter += 1
		edges.sort()


l = [int(x) for x in input().split()]
l.sort()
diff = l[2] - l[1] - l[0]
if diff < 0:
	print(0)
else:
	print(diff + 1)


l = sorted(list(map(int, input().split())))
if l[2] >= l[0] + l[1]:
	print(l[2] - abs(l[0] + l[1]) + 1)
else:
	print(0)


a = list(map(int, input().split()))
b = max(a)
a.remove(b)
print(max(0, b + 1 - a[0] - a[1]))


(a, b, c) = map(int, input().split())
m = max(a, b, c)
print(max(0, m - a - b - c + m + 1))


l = list(map(int, input().split(' ')))
najv = l.index(max(l))
odpoved = l[najv]
for i in range(len(l)):
	if i != najv:
		odpoved -= l[i]
if odpoved >= 0:
	print(odpoved + 1)
else:
	print(0)


sides = list(map(int, input().split()))
sides.sort()
min = 0
while sides[0] + sides[1] <= sides[2]:
	sides[0] += 1
	min += 1
print(min)


ls = [*map(int, input().split())]
ls.sort()
print(0 if ls[0] + ls[1] > ls[2] else ls[2] + 1 - ls[1] - ls[0])


(a, b, c) = map(int, input().split())
if max(a, b, c) == a:
	k = a - (b + c)
	if k < 0:
		print(0)
	else:
		print(k + 1)
elif max(a, b, c) == b:
	l = b - (a + c)
	if l < 0:
		print(0)
	else:
		print(l + 1)
elif max(a, b, c) == c:
	m = c - (a + b)
	if m < 0:
		print(0)
	else:
		print(m + 1)


sum = 0
longest = 0
(a, b, c) = map(int, input().strip().split())
if a >= b and a >= c:
	sum = b + c
	longest = a
elif b >= a and b >= c:
	sum = a + c
	longest = b
elif c >= a and c >= b:
	sum = a + b
	longest = c
if sum > longest:
	print(0)
else:
	print(longest - sum + 1)


(a, b, c) = map(int, input().split())
ans = 0
while a >= b + c or b >= c + a or c >= a + b:
	if a <= b and a <= c:
		a += 1
	elif b <= a and b <= c:
		b += 1
	else:
		c += 1
	ans += 1
print(ans)


(a, b, c) = map(int, input().split())
s = [a, b, c]
s.sort()
n = max(0, s[2] - s[0] - s[1] + 1)
print(n)


s = [int(x) for x in input().split()]
s.sort()
print(max(0, s[2] - s[1] - s[0] + 1))


n = list(map(int, input().split()))
n_max = max(n)
n.remove(n_max)
count = 0
for i in range(2):
	count += n[i]
if count > n_max:
	l = 0
elif count <= n_max:
	n_max = n_max + 1
	l = n_max - (n[0] + n[1])
print(l)


(num1, num2, num3) = map(int, input().split())
ma = max(num1, num2, num3)
num = num1 + num2 + num3 - ma
if ma < num:
	res = 0
else:
	res = ma - num + 1
print(res)


triangle = list(map(int, input().split()))
triangle.sort()
if triangle[0] + triangle[1] > triangle[2]:
	required = 0
else:
	required = triangle[2] - (triangle[0] + triangle[1]) + 1
print(required)


a = sorted(map(int, input().split()))
print(max(0, 1 + a[-1] - sum(a[:2])))


(a, b, c) = list(map(int, input().split()))
maxi = max(a, b, c)
x = [a, b, c]
x.remove(maxi)
s = maxi - sum(x) + 1
print(max(s, 0))


k = list(map(int, input().split()))
k.sort(reverse=True)
(c, b, a) = (k[0], k[1], k[2])
print(max(0, c - (a + b - 1)))


from sys import stdin, stdout
input = stdin.readline

def u(x):
	if x < 0:
		return 0
	return x
(a, b, c) = list(map(int, input().split()))
if a < b + c and b < c + a and (c < b + a):
	print(0)
else:
	t = sorted([a, b, c])
	s = t[-1]
	print(s - sum(t[:2]) + 1)


(a, b, c) = map(int, input().split())
t = sorted([a, b, c])
ans = 0
while t[2] >= t[0] + t[1]:
	t[0] += 1
	ans += 1
print(ans)


array = list(map(int, input().split()))
a = max(array)
array.pop(array.index(max(array)))
if sum(array) - a > 0:
	print(0)
else:
	print(a - sum(array) + 1)


arr = list(map(int, input().split()))
arr.sort()
print((arr[2] - (arr[0] + arr[1]) + 1) * (arr[0] + arr[1] - arr[2] <= 0))
del arr


(a, b, c) = map(int, input().split())
longest = max(a, b, c)
shortest = min(a, b, c)
remaining = a + b + c - (longest + shortest)
k = 0
while longest >= shortest + remaining:
	shortest = shortest + 1
	k = k + 1
print(k)


x = [int(i) for i in input().split()]
x.sort()
if x[2] >= x[1] + x[0]:
	print(1 + x[2] - (x[1] + x[0]))
else:
	print(0)


a = list(map(int, input().split()))
a.sort()
print(max(a[2] - a[0] - a[1] + 1, 0))


import time

def calculateArea(a, b, c):
	maxNum = max(a, b, c)
	minMin = 0
	if a == maxNum:
		sideSum = b + c
	elif b == maxNum:
		sideSum = a + c
	elif c == maxNum:
		sideSum = a + b
	if maxNum < sideSum:
		return minMin
	else:
		minMin = maxNum - sideSum + 1
	return minMin

def solve():
	(a, b, c) = [int(x) for x in input().split()]
	print(calculateArea(a, b, c))
solve()


(a, b, c) = input().split()
(a, b, c) = (int(a), int(b), int(c))
x = min([a, b, c])
y = max([a, b, c])
l = [a, b, c]
l.remove(x)
l.remove(y)
z = l[0]
(y, z) = (z, y)
t = 0
while x + y <= z:
	x += 1
	t += 1
print(t)


(a, b, c) = list(map(int, input().strip().split()))
z = max([a, b, c])
m1 = m2 = 0
if z == c:
	m1 = a
	m2 = b
elif z == b:
	m1 = a
	m2 = c
else:
	m1 = b
	m2 = c
if m1 + m2 > z:
	print(0)
else:
	print(z - m1 - m2 + 1)


arr = list(map(int, input().split()))
arr.sort()
ans = 0
while arr[2] >= arr[0] + arr[1]:
	arr[0] += 1
	ans += 1
print(ans)


s = str(input())
(a, b, c) = sorted([int(elt) for elt in s.split(' ')])
att = 0
while not (c - b < a < c + b and b - a < c < b + a and (c - a < b < c + a)):
	att += 1
	(a, b, c) = sorted([a + 1, b, c])
print(att)


def solve(test):
	a = list(map(int, input().split()))
	a.sort()
	print(max(0, a[2] - a[1] - a[0] + 1))
t = 1
for _ in range(t):
	solve(_ + 1)


L = sorted(map(int, input().split()))
if L[0] + L[1] > L[2]:
	print(0)
else:
	print(L[2] - L[1] - L[0] + 1)


a = list(map(int, input().split()))
d = sum(a) - 2 * max(a)
print(0 if d > 0 else 1 - d)


(a, b, c) = map(int, input().split())
if a + b > c and b + c > a and (c + a > b):
	print(0)
else:
	t = max(a, b, c)
	print(2 * t - (a + b + c) + 1)


(a, b, c) = list(map(int, input().split()))
x = a + b
y = b + c
z = a + c
count = 0
if x <= c:
	count += c - x + 1
elif y <= a:
	count += a - y + 1
elif z <= b:
	count += b - z + 1
print(count)


a_b_c = list(map(int, input().split(' ')))
a_b_c.sort()
(a, b, c) = a_b_c
if a + b <= c:
	print(c - (a + b) + 1)
else:
	print(0)


(a, b, c) = [int(x) for x in input().split()]
bc = b + c
ret = 0
if a >= bc:
	ret = a - bc + 1
	b += a - bc + 1
ac = a + c
if b >= ac:
	ret += b - ac + 1
	c += b - ac + 1
ab = a + b
if c >= ab:
	ret += c - ab + 1
print(ret)


[a, b, c] = [int(i) for i in input().split()]
if a + b <= c:
	print(c - a - b + 1)
elif b + c <= a:
	print(a - c - b + 1)
elif a + c <= b:
	print(b - a - c + 1)
else:
	print(0)


def max1(a):
	p = a[0]
	for x in a:
		if x > p:
			p = x
	return p

def preobr(x):
	if x % 2 == 1:
		return x + 1
	else:
		return x - 1

def prlist(a):
	for x in a:
		print(x, end=' ')

def dlin(n):
	k = 0
	while n > 0:
		n -= k
		k += 1
	return k - 1

def foundm(x, a):
	for i in range(len(a)):
		if x == a[i]:
			return i
	return -1
a = list(map(int, input().split()))
s = 0
t = max1(a)
fl = True
for x in a:
	if x != t or not fl:
		s += x
	else:
		fl = False
if s > t:
	print(0)
else:
	print(t - s + 1)


a = [int(i) for i in input().split()]
a.sort()
count = 0
while a[0] >= a[1] + a[2] or a[1] >= a[0] + a[2] or a[2] >= a[0] + a[1]:
	a[0] += 1
	count += 1
print(count)


tmp = input().split()
arr = []
for i in tmp:
	arr.append(int(i))
tmp = 0
for i in range(2):
	for j in range(i + 1, 3, 1):
		if arr[i] > arr[j]:
			tmp = arr[i]
			arr[i] = arr[j]
			arr[j] = tmp
min = arr[0] - arr[1]
if min < 0:
	min = 0 - min
max = arr[0] + arr[1]
if max - 1 < arr[2]:
	print(int(arr[2] - max + 1))
else:
	print('0')


sides = list(map(int, input().split()))
sides.sort()
diff = sides[2] - (sides[0] + sides[1])
print(max(0, diff + 1))


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


(a, b, c) = map(int, input().split())
m = max(a, max(b, c))
ans = a + b + c - 2 * m - 1
ans = -ans
if ans < 0:
	print(0)
else:
	print(ans)


(a, b, c) = map(int, input().split())
l = [a, b, c]
a1 = []
k = 0
max1 = max(l)
if a == b and b == c:
	print(0)
	exit()
for i in l:
	if i == max1 and k == 0:
		k = 1
		pass
	else:
		a1.append(i)
if sum(a1) > max1:
	print(0)
	exit()
if max1 - sum(a1) >= 0:
	print(max1 - sum(a1) + 1)
else:
	print(0)


def ans(x):
	m = 0
	for i in range(1, len(x)):
		if x[i] > x[m]:
			m = i
	r = sum(x) - x[m]
	if r > x[m]:
		return 0
	else:
		return x[m] - r + 1
li = list(map(int, input().split(' ')))
print(ans(li))


def make_triangle():
	(a, b, c) = map(int, input().split())
	if a + b > c:
		if a + c > b:
			if c + b > a:
				print(0)
			else:
				print(a - c - b + 1)
		else:
			print(b - a - c + 1)
	else:
		print(c - a - b + 1)
make_triangle()


sides = list(map(int, input().split()))
sides.sort()
print(max(0, sides[-1] - sides[0] - sides[1] + 1))


m = list(map(int, input().split()))
m.sort()
count = 0
if m[0] + m[1] <= m[2]:
	count = m[2] - (m[0] + m[1]) + 1
print(count)


import sys
if sys.version_info < (3, 0):
	input = raw_input
(a, b, c) = [int(x) for x in input().split()]
A = min(a, b, c)
C = max(a, b, c)
S = [a, b, c]
S.remove(A)
S.remove(C)
B = list(S)[0]

def solution(two_shortest, longest):
	if two_shortest > longest:
		return 0
	else:
		return longest - two_shortest + 1
print(solution(A + B, C))


(x, y, z) = map(int, input().split(' '))
c1 = 10000
c2 = 10000
c3 = 10000
if x + y > z and y + z > x and (x + z > y):
	print(0)
else:
	if x + y <= z:
		c1 = z - (x + y) + 1
	elif y + z <= x:
		c2 = x - (y + z) + 1
	elif z + x <= y:
		c3 = y - (x + z) + 1
	print(min(c1, min(c2, c3)))


(x, y, z) = input().split()
n = [x, y, z]
a = 0
n[0] = int(n[0])
n[1] = int(n[1])
n[2] = int(n[2])
while n[0] + n[1] <= n[2]:
	if n[0] > n[1]:
		n[1] = n[1] + 1
		a += 1
	elif n[0] < n[1]:
		n[0] = n[0] + 1
		a += 1
	elif n[0] == n[1]:
		a += 1
		n[0] = n[0] + 1
while n[1] + n[2] <= n[0]:
	if n[1] > n[2]:
		n[2] = n[2] + 1
		a += 1
	elif n[1] < n[2]:
		n[1] = n[1] + 1
		a += 1
	elif n[1] == n[2]:
		a += 1
		n[1] = n[1] + 1
while n[2] + n[0] <= n[1]:
	if n[2] > n[0]:
		n[0] = n[0] + 1
		a += 1
	elif n[2] < n[0]:
		n[2] = n[2] + 1
		a += 1
	elif n[2] == n[0]:
		a += 1
		n[2] = n[2] + 1
print(a)


mat = list(map(int, input().split()))
mat = sorted(mat)
print(max(mat[2] - mat[0] - mat[1] + 1, 0))


l = list(map(int, input().split()))
a = 0
b = 0
m = max(l)
if m == l[0]:
	a = l[1]
	b = l[2]
elif m == l[1]:
	a = l[0]
	b = l[2]
else:
	a = l[0]
	b = l[1]
if a + b > m:
	print('0')
else:
	print(m - (a + b) + 1)


[a, b, c] = list(map(int, input().rstrip().split()))
m = max(a, b, c)
s = a + b + c
rs = s - m
print(max(0, m - rs + 1))


a = sorted(list(map(int, input().split())))
k = a[2] - a[0] - a[1]
if k < 0:
	print(0)
else:
	print(k + 1)


mainInput = input().split(' ')
NoMin = 0
for i in range(len(mainInput)):
	mainInput[i] = int(mainInput[i])
while True:
	if mainInput[0] + mainInput[1] > mainInput[2] and mainInput[1] + mainInput[2] > mainInput[0] and (mainInput[0] + mainInput[2] > mainInput[1]):
		print(NoMin)
		break
	else:
		mainInput[mainInput.index(min(mainInput))] += 1
		NoMin += 1


inp = [int(x) for x in input().split()]
m = max(inp)
inp.remove(m)
print(max(m - sum(inp) + 1, 0))


(a, b, c) = map(int, input().split())
m = float('inf')
if a < b + c and b < a + c and (c < a + b):
	print('0')
	exit()
elif a >= b + c:
	m = min(m, abs(b + c - a))
elif b >= a + c:
	m = min(m, abs(c + a - b))
elif c >= a + b:
	m = min(m, abs(b + a - c))
print(m + 1)


from sys import stdin

def main():
	ABC = list(map(int, input().split()))
	n = sorted(ABC)
	ans = 0
	if n[0] + n[1] <= n[2]:
		ans = n[2] - n[0] - n[1] + 1
	print(ans)
input = lambda : stdin.readline().rstrip()
main()


(x, y, z) = map(int, input().split())
co = 0
while x <= abs(z - y):
	x += 1
	co += 1
while y <= abs(z - x):
	y += 1
	co += 1
while z <= abs(x - y):
	z += 1
	co += 1
print(co)


ar = list(map(int, input().split()))
ar.sort()
val = ar[2] - (ar[0] + ar[1])
print(0) if val < 0 else print(val + 1)


(a, b, c) = map(int, input().split())
n = [a, b, c]
n.sort()
i = 0
while n[0] + n[1] <= n[2]:
	i += 1
	n[0] += 1
print(i)


E = [int(a) for a in input().split()]
E.sort()
print(max(0, E[2] - E[1] - E[0] + 1))


def solve():
	a = [int(x) for x in input().split()]
	print(max(0, max(a) - (sum(a) - max(a)) + 1))
solve()


l = list(map(int, input().split()))
l.sort()
print(max(0, l[2] - (l[0] + l[1] - 1)))


import math
(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
t = 0
maxx = max(max(a, b), c)
minn = min(min(a, b), c)
midd = a + b + c - minn - maxx
if maxx - midd - minn >= 0:
	t = maxx - midd - minn + 1
print(t)


sisi = [int(item) for item in input().split(' ')]
if sisi[0] + sisi[1] > sisi[2]:
	if sisi[1] + sisi[2] > sisi[0]:
		if sisi[0] + sisi[2] > sisi[1]:
			print(0)
		else:
			print(sisi[1] - (sisi[0] + sisi[2]) + 1)
	else:
		print(sisi[0] - (sisi[1] + sisi[2]) + 1)
else:
	print(sisi[2] - (sisi[0] + sisi[1]) + 1)


(x, p) = (sorted([int(_) for _ in input().split()]), 0)
while x[0] + x[1] <= x[2]:
	x[0] += 1
	p += 1
print(p)


(a, b, c) = input().split()
d = [int(a), int(b), int(c)]
d.sort()
if d[0] + d[1] > d[2]:
	print(0)
else:
	print(d[2] + 1 - d[0] - d[1])


ls = list(map(int, input().split(' ')))
a = max(ls)
ls.remove(a)
asum = sum(ls)
if asum > a:
	time = 0
else:
	time = abs(a - asum + 1)
print(time)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	a = sorted(LI())
	t = a[2] - a[1] - a[0]
	return max(t + 1, 0)
print(main())


abc = tuple(map(int, input().split()))
if 2 * max(abc) >= sum(abc):
	print(2 * max(abc) - sum(abc) + 1)
else:
	print(0)


args = [int(x) for x in input().split(' ')]
m = max(args)
args.remove(m)
if sum(args) > m:
	print('0')
else:
	print(m - sum(args) + 1)


s = input()
s = [int(x) for x in s.split()]
s = sorted(s)
time = s[-1] - (s[0] + s[1])
if time < 0:
	print(0)
else:
	print(time + 1)


(a, b, c) = [int(x) for x in input().split(' ')]
counter = 0
for i in range(10000000):
	w = 'G'
	if not a + b > c:
		if b <= a:
			b += 1
			counter += 1
		else:
			a += 1
			counter += 1
		w = ''
	if not a + c > b:
		if c <= a:
			c += 1
			counter += 1
		else:
			a += 1
			counter += 1
		w = ''
	if not b + c > a:
		if b <= c:
			b += 1
			counter += 1
		else:
			c += 1
			counter += 1
		w = ''
	if w == 'G':
		break
print(counter)


(a, b, c) = map(int, input().split())
x = 0
while 1:
	if a + b > c and b + c > a and (c + a > b):
		break
	else:
		y = min(a, b, c)
		if a == y:
			a += 1
		elif b == y:
			b += 1
		else:
			c += 1
		x += 1
print(x)


(a, b, c) = [float(i) for i in input().split()]
n = [a, b, c]
n.sort()
a = abs(n[0])
b = abs(n[1])
c = abs(n[2])
m = a + b
n = m - c
g = 0
while n <= 0:
	n += 1
	g += 1
print(g)


a = input().split()
b = int(a[1])
c = int(a[2])
a = int(a[0])
if a > c:
	(a, c) = (c, a)
if b > c:
	(b, c) = (c, b)
x = c - a - b
if x < 0:
	print(0)
else:
	print(x + 1)


a = list(map(int, input().split()))
count = 0
m = max(a)
a.remove(m)
if m < a[0] + a[1]:
	print(0)
else:
	print(m - (a[0] + a[1]) + 1)


(a, b, c) = map(int, input().split())
d = 0
if a + b <= c:
	d = d + (c - (a + b - 1))
else:
	pass
if c + b <= a:
	d = d + (a - (c + b - 1))
else:
	pass
if a + c <= b:
	d = d + (b - (a + c - 1))
else:
	pass
print(d)


from sys import stdin, stdout, exit, setrecursionlimit

def sin():
	return stdin.readline().rstrip()

def listInput():
	return list(map(int, sin().split()))

def printBS(li):
	if not li:
		return
	for i in range(len(li) - 1):
		stdout.write('%d ' % li[i])
	stdout.write('%d\n' % li[-1])
(a, b, c) = listInput()
(a, b, c) = sorted([a, b, c])
print(max(0, c - a - b + 1))


a = list(map(int, input().split(' ')))
b = [a[2] + a[1], a[0] + a[2], a[0] + a[1]]
s = 0
for i in range(3):
	if b[i] <= a[i]:
		s = a[i] - b[i] + 1
print(s)


def main():
	(a, b, c) = sorted(list(map(int, input().split())))
	res = 9999999999999
	for i in range(a, c + 1):
		for j in range(b, c + 1):
			if i + j > c and i + c > j and (j + c > i):
				res = min(res, i + j - a - b)
				break
	print(res)
main()


list1 = list(map(int, input().strip().split(' ')))
list1.sort()
time = 0
if list1[0] + list1[1] > list1[2]:
	print(time)
else:
	time = list1[2] - (list1[1] + list1[0]) + 1
	print(time)


entrada = input().split(' ')
for i in range(len(entrada)):
	entrada[i] = int(entrada[i])
entrada.sort()
if entrada[0] + entrada[1] > entrada[2]:
	print(0)
else:
	tempo = entrada[2] + 1 - entrada[1] - entrada[0]
	print(tempo)


l = list(map(int, input().split()))
m = max(l)
s = sum(l) - m
if s > m:
	print(0)
else:
	print(m - s + 1)


(a, b, c) = map(int, input().split())
t = max(a, b, c)
n = t - (a + b + c - t)
if n < 0:
	print(0)
else:
	print(n + 1)


(a, b, c) = map(int, input().split())
if a >= b and a >= c:
	m1 = a
	if b >= c:
		m2 = b
		m3 = c
	else:
		m2 = c
		m3 = b
elif a >= b and a <= c:
	m1 = c
	m2 = a
	m3 = b
else:
	m3 = a
	if b >= c:
		m1 = b
		m2 = c
	else:
		m1 = c
		m2 = b
if m3 + m2 > m1:
	print('0')
else:
	print(m1 - (m2 + m3) + 1)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	l = []
	for i in range(2, n + 1):
		if prime[i]:
			l.append(i)
	return l

def bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, ll, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		if ll[mid] == val:
			return ll[mid]
		elif ll[mid] < val:
			ans = ll[mid]
			return binary(mid + 1, r, ll, val, ans)
		else:
			return binary(l, mid - 1, ll, val, ans)

def check(n):
	v = 1
	while n != 0:
		if n % 10 == 0 or n % 10 == 1:
			n = n // 10
		else:
			v = 0
			break
	return v
l = list(map(int, input().split(' ')))
l.sort()
if l[0] + l[1] > l[2]:
	print(0)
else:
	print(l[2] - (l[0] + l[1]) + 1)


from sys import stdin, stdout

def main():
	e = [int(c) for c in stdin.readline().split()]
	e.sort()
	res = max(0, e[2] + 1 - (e[1] + e[0]))
	stdout.write(str(res) + '\n')
main()


entrada = input().split()
sides = [int(x) for x in entrada]
(a, b, c) = (sides[0], sides[1], sides[2])
sides.sort()
ans = 0
if sum(sides[:2]) <= sides[-1]:
	ans = sides[-1] - sum(sides[:2]) + 1
print(ans)


ar = sorted(map(int, input().split()))
ans = 1 + ar[2] - ar[0] - ar[1]
print(ans if ans > 0 else 0)


(a, b, c) = list(map(int, input().split()))
d = [a, b, c]
min1 = 0
d.sort()
[a, b, c] = d
while a + b <= c:
	a += 1
	min1 += 1
print(min1)


arr = [int(x) for x in input().split()]
arr.sort()
a = arr[0]
b = arr[1]
c = arr[2]
if a + b > c:
	print(0)
else:
	print(c - a - b + 1)


(a, b, c) = map(int, input().split())
m = 0
while True:
	ab = a + b - c - 1
	if ab < 0:
		(a, b) = (a - ab // 2, b - (ab // 2 + ab % 2))
		m -= ab
	bc = b + c - a - 1
	if bc < 0:
		(b, c) = (b - bc // 2, c - (bc // 2 + bc % 2))
		m -= bc
	ac = a + c - b - 1
	if ac < 0:
		(a, c) = (a - ac // 2, c - (ac // 2 + ac % 2))
		m -= ac
	if a + b > c and b + c > a and (a + c > b):
		break
print(m)


s = input()
l = s.split()
(a, b, c) = (int(l[0]), int(l[1]), int(l[2]))

def side_of_triangle(a1, b1, c1):
	while a1 + b1 <= c1:
		if a1 < b1:
			a1 += 1
		else:
			b1 += 1
	while b1 + c1 <= a1:
		if b1 < c1:
			b1 += 1
		else:
			c1 += 1
	while a1 + c1 <= b1:
		if a1 < c1:
			a1 += 1
		else:
			c1 += 1
	return (a1, b1, c1)
(a1, b1, c1) = side_of_triangle(a, b, c)
print(abs(a - a1) + abs(b - b1) + abs(c - c1))


a = list(map(int, input().split()))
out = 0
while True:
	if a[0] + a[1] > a[2] and a[0] + a[2] > a[1] and (a[2] + a[1] > a[0]):
		print(out)
		break
	else:
		a[a.index(min(a))] += 1
		out += 1


a = list(map(int, input().split()))
m = max(a)
a.remove(m)
s = sum(a)
if s > m:
	print(0)
else:
	print(m - s + 1)


arr = sorted(map(int, input().split()))
print(max(0, arr[2] - arr[1] - arr[0] + 1))


(a, b, c) = map(int, input().split())
x = min(a, b, c)
z = 0
s = a + b + c - x - max(a, b, c)
while x + s + z <= max(a, b, c):
	z += 1
print(z)


import sys
import math
(a, b, c) = map(int, input().split())
yak = [a, b, c]
yak = sorted(yak)
(a, b, c) = (yak[0], yak[1], yak[2])
if a + b > c:
	print('0')
else:
	print(c + 1 - (a + b))


a = list(map(int, input().split()))
s = sum(a)
q = max(a)
p = s - q
if p > q:
	print(0)
else:
	print(q - p + 1)


a = [int(a) for a in input().split()]
b = 0
if a[0] + a[1] <= a[2]:
	b = b + (a[2] - (a[0] + a[1]) + 1)
if a[0] + a[2] <= a[1]:
	b = b + (a[1] - (a[0] + a[2]) + 1)
if a[2] + a[1] <= a[0]:
	b = b + (a[0] - (a[2] + a[1]) + 1)
print(b)


triag = list(sorted(map(int, input().split())))
s = 0
while triag[0] + triag[1] <= triag[2]:
	triag[0] += 1
	s += 1
print(s)


(a, b, c) = map(int, input().split())
x = [a, b, c]
y = max(x)
x.remove(max(x))
if sum(x) > y:
	print(0)
else:
	print(abs(y - sum(x) + 1))


(a, b, c) = map(int, input().split())
min_side1 = min(a, b, c)
if min_side1 == a:
	if b < c:
		min_side2 = b
		max_side = c
	else:
		min_side2 = c
		max_side = b
elif min_side1 == b:
	if a < c:
		min_side2 = a
		max_side = c
	else:
		min_side2 = c
		max_side = a
elif a < b:
	min_side2 = a
	max_side = b
else:
	min_side2 = b
	max_side = a
minutes = max_side - (min_side1 + min_side2) + 1
if minutes < 0:
	print(0)
else:
	print(minutes)


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
sides = sorted(map(int, input().split()))
if sides[2] < sides[0] + sides[1]:
	print(0)
else:
	print(sides[2] - (sides[0] + sides[1]) + 1)


A = list(map(int, input().split()))
ans = 10 ** 18
for i in range(3):
	a = A[i]
	(b, c) = A[:i] + A[i + 1:]
	low = abs(b - c) + 1
	tmp = 0
	if a < low:
		tmp = low - a
		a = low
	if a >= b + c:
		continue
	ans = min(ans, tmp)
print(ans)


(a, b, c) = map(int, input().split())
l = [a, b, c]
l.sort()
a = l[0]
b = l[1]
c = l[2]
count = 0
while a + b <= c:
	count += 1
	b += 1
print(count)


a = [0, 0, 0]
(a[0], a[1], a[2]) = map(int, input().split())
a.sort()
s = (a[0] + a[1] + a[2]) / 2
t = 0
while (s - a[0]) * (s - a[1]) * (s - a[2]) <= 0:
	a[0] += 1
	t += 1
	s = (a[0] + a[1] + a[2]) / 2
print(t)


line = input()
num = line.split()
a = int(num[0])
b = int(num[1])
c = int(num[2])
temp = [a, b, c]
temp.sort()
if temp[0] + temp[1] > temp[2]:
	print(0)
else:
	print(temp[2] - temp[1] - temp[0] + 1)


from sys import stdin, stdout

def main():
	(a, b, c) = map(int, stdin.readline().split())
	cnt = 0
	while a + b <= c or b + c <= a or c + a <= b:
		cnt += 1
		if a + b <= c:
			if a <= b:
				a += 1
			else:
				b += 1
		elif b + c <= a:
			if b <= c:
				b += 1
			else:
				c += 1
		elif c <= a:
			c += 1
		else:
			a += 1
	stdout.write('%d' % cnt)
main()


(a, b, c) = map(int, input().split())
flag = 0
count = 0
while flag != 3:
	flag = 0
	if a + b > c:
		flag += 1
	if b + c > a:
		flag += 1
	if a + c > b:
		flag += 1
	if flag != 3:
		li = [a, b, c]
		temp = min(li)
		li.remove(temp)
		temp += 1
		count += 1
		li.append(temp)
		(a, b, c) = li
print(count)


(x, y, z) = map(int, input().split())
if x + y <= z:
	print(z - (x + y) + 1)
elif x + z <= y:
	print(y - (x + z) + 1)
elif z + y <= x:
	print(x - (z + y) + 1)
else:
	print(0)


(a, b, c) = map(int, input().split())
if a + b > c and b + c > a and (a + c > b):
	rez = 0
else:
	rez = max(a, b, c)
	rez = rez - min(a + b, a + c, b + c)
	rez += 1
print(rez)


def main():
	(a, b, c) = map(int, input().split())
	step = 0
	while True:
		if a + b <= c:
			if a > b:
				a += 1
			else:
				b += 1
			step += 1
		elif a + c <= b:
			if a > c:
				a += 1
			else:
				c += 1
			step += 1
		elif b + c <= a:
			if b > c:
				b += 1
			else:
				c += 1
			step += 1
		else:
			break
	print(step)
main()


(a, b, c) = map(int, input().split())
count = 0
if a + b <= c:
	count = c - (a + b) + 1
if a + c <= b:
	count = b - (a + c) + 1
if c + b <= a:
	count = a - (c + b) + 1
print(count)


a = list(map(int, input().split()))
a.sort()
s = k = 0
while s == 0:
	if a[0] + a[1] <= a[2]:
		k += 1
		if a[0] < a[1]:
			a[0] += 1
		else:
			a[1] += 1
	else:
		s = 1
print(k)


a = [int(i) for i in input().split()]
print(max(2 * max(a) - sum(a) + 1, 0))


(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
tmin = 400
for i in range(a, 101, 1):
	for j in range(b, 101, 1):
		for k in range(c, 101, 1):
			if i + k > j and i + j > k and (j + k > i):
				t = i - a + (j - b) + (k - c)
				if tmin > t:
					tmin = t
print(tmin)


def check_tri(a, b, c):
	if a + b > c and a + c > b and (b + c > a):
		return True
	return False

def solve():
	(a, b, c) = [int(x) for x in input().split(' ')]
	temp_a = 0
	temp_b = 0
	temp_c = 0
	ans = 0
	while not check_tri(a, b, c):
		if a + b <= c:
			a += 1
			ans += 1
		if a + c <= b:
			c += 1
			ans += 1
		if b + c <= a:
			b += 1
			ans += 1
	print(ans)
solve()


s = list(map(int, input().split()))
m = 0
a = sorted(s)
if a[0] + a[1] > a[2]:
	print(m)
else:
	print(a[2] + 1 - a[0] - a[1])


(aa, bb, cc) = list(map(int, input().split(' ')))
s = [aa, bb, cc]
s.sort()
a = s[0]
b = s[1]
c = s[2]
if c < a + b:
	print(0)
else:
	print(str(c - (a + b) + 1))


n = input()
x = n.split()
a = int(x[0])
b = int(x[1])
c = int(x[2])
ans = 9999
if a >= b + c:
	ans = min(ans, a - (b + c) + 1)
elif b >= a + c:
	ans = min(ans, b - (a + c) + 1)
elif c >= a + b:
	ans = min(ans, c - (a + b) + 1)
else:
	ans = 0
print(ans)


(a, b, c) = [int(x) for x in input().split()]
inequacoes = [a + b - c, b + c - a, c + a - b]
if min(inequacoes) == 0:
	print(1)
elif min(inequacoes) < 0:
	print(abs(min(inequacoes)) + 1)
else:
	print(0)


def make_triangle(t):
	(a, b, c) = sorted(t)
	if c < a + b:
		return 0
	return c + 1 - (a + b)

def main():
	sides = map(int, input().split())
	print(make_triangle(sides))
main()


from typing import Dict, List
(a, b, c) = (int(val) for val in input().split())
borders = [a, b, c]
borders.sort()
max_border = borders[2]
mid_border = borders[1]
min_border = borders[0]
delta = 1e-12
res = max_border - (mid_border + min_border) + 1
if res < 0:
	res = 0
print(res)


line = input()
values = [int(x) for x in line.split()]
t = 0
condition = True
while condition:
	validation1 = values[0] + values[1] > values[2]
	validation2 = values[0] + values[2] > values[1]
	validation3 = values[1] + values[2] > values[0]
	if validation1 and validation2 and validation3:
		condition = False
	else:
		pos = values.index(min(values))
		values[pos] += 1
		t += 1
print(t)


(a, b, c) = [int(a) for a in input().split()]
ans = 0
if a + b <= c:
	ans += c - (a + b) + 1
	a += c - (a + b) + 1
if a + c <= b:
	ans += b - (a + c) + 1
	a += b - (a + c) + 1
if b + c <= a:
	ans += a - (c + b) + 1
	b += a - (c + b) + 1
print(ans)


a = sorted([int(x) for x in input().split()])
(a, b, c) = (a[0], a[1], a[2])
s = 0
while a + b <= c:
	s += 1
	a += 1
print(s)


list1 = sorted(map(int, input().split(' ')))
a = list1[0]
b = list1[1]
c = list1[2]
print(max(0, c - (a + b - 1)))


(x, y, z) = [int(i) for i in input().split()]
a = 0
while x >= y + z or y >= x + z or z >= x + y:
	while x >= y + z:
		y += 1
		a += 1
	while y >= x + z:
		z += 1
		a += 1
	while z >= x + y:
		x += 1
		a += 1
print(a)


from sys import stdin, stdout
import cProfile, math
from collections import Counter
printHeap = str()
test = False
memory_constrained = False

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def test_print(output):
	if test:
		stdout.write(str(output) + '\n')

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def main():
	li = get_list()
	li.sort()
	print(0) if 1 + li[2] - (li[0] + li[1]) < 0 else print(1 + li[2] - (li[0] + li[1]))
cProfile.run('main()') if test else main()


a = [int(i) for i in input().strip().split()]
a.sort()
if sum(a[:2]) > a[2]:
	print(0)
else:
	print(a[2] - sum(a[:2]) + 1)


lst = list(map(int, input().split()))
lst.sort()
i = -1
count = 0
while True:
	if lst[0] + lst[1] - 1 >= lst[2]:
		break
	else:
		if i < 0:
			lst[0] += 1
		else:
			lst[1] += 1
		count += 1
		i *= -1
print(count)


(a, b, c) = [int(x) for x in input().split()]
m = 0
if a + b <= c:
	m += c - a - b + 1
if b + c <= a:
	m += a - b - c + 1
if c + a <= b:
	m += b - c - a + 1
print(m)


(a, b, c) = map(int, input().split())
d = 0
while a >= b + c or b >= a + c or c >= a + b:
	d += 1
	m = min(a, b, c)
	if a == m:
		a += 1
	elif b == m:
		b += 1
	else:
		c += 1
print(d)


(a, b, c) = map(int, input().split())
large = max(a, b, c)
mins = max(0, large - (a + b + c - 1 - large))
print(mins)


(a, b, c) = map(int, input().split())
i = 0
while a + b <= c or b + c <= a or a + c <= b:
	if a == min(a, b, c):
		a = a + 1
		i = i + 1
	elif b == min(a, b, c):
		b = b + 1
		i = i + 1
	elif c == min(a, b, c):
		c = c + 1
		i = i + 1
print(i)


l = list(map(int, input().split(' ')))
(a, c) = (max(l), min(l))
l.remove(a)
b = max(l)
minutes = 0
while c <= a - b:
	c += 1
	minutes += 1
print(minutes)


l = list(map(int, input().split()))
l.sort()
m = l[2] - l[0] - l[1]
if m < 0:
	print(0)
else:
	print(m + 1)


(a, b, c) = [int(x) for x in input().split()]
if a + b + c > max(a, b, c) * 2:
	print(0)
else:
	print(max(a, b, c) * 2 - a - b - c + 1)


from math import sqrt, ceil
(a, b, c) = map(int, input().split())
mx = max(a, b, c)
if a == mx:
	if b + c > a:
		print(0)
	else:
		print(a + 1 - b - c)
elif b == mx:
	if a + c > b:
		print(0)
	else:
		print(b + 1 - a - c)
elif a + b > c:
	print(0)
else:
	print(c + 1 - a - b)


l = map(int, input().split())
(a, b, c) = sorted(l, reverse=True)
if a >= b + c:
	print(a - (b + c) + 1)
else:
	print(0)


[a, b, c] = list(map(int, input().split()))
indicies = [a, b, c]
total = a + b + c
answer = 0

def maximum(indicies):
	Max = 0
	for item in indicies:
		if item > Max:
			Max = item
	return Max
if a + b > c and b + c > a and (a + c > b):
	print(0)
else:
	answer = maximum(indicies) + 1 - total + maximum(indicies)
	print(answer)


def main():
	(a, b, c) = map(int, input().split())
	if a + b <= c:
		return c - a - b + 1
	elif a + c <= b:
		return b - a - c + 1
	elif b + c <= a:
		return a - b - c + 1
	else:
		return 0
res = main()
print(res)


k = input().split()
x = int(k[0])
y = int(k[1])
z = int(k[2])
if x + y > z and x + z > y and (y + z > x):
	print(0)
elif x + y <= z:
	print(z - (x + y) + 1)
elif x + z <= y:
	print(y - (x + z) + 1)
else:
	print(x - (y + z) + 1)


(a, b, c) = map(int, input().split())
d = max(a, b, c)
e = a + b + c - d
if d < e:
	print(0)
else:
	print(d - e + 1)


a = [int(i) for i in input().split()]
a.sort(reverse=True)
c = 0
while a[0] > a[1] + a[2] - 1:
	a[1] += 1
	c += 1
print(c)


def main():
	side = list(map(int, input().split()))
	(a, b, c) = sorted(side)
	print(max(c - a - b + 1, 0))
main()


a = [int(x) for x in input().split()]
a.sort()
c = 0
if a[0] + a[1] > a[2]:
	c = 0
elif a[0] + a[1] <= a[2]:
	c += a[2] - a[1] - a[0] + 1
print(c)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
count = 0
lst = [a, b, c]
while lst[0] + lst[1] <= lst[2] or lst[0] + lst[2] <= lst[1] or lst[2] + lst[1] <= lst[0]:
	idx = lst.index(min(lst))
	lst[idx] = lst[idx] + 1
	count = count + 1
print(count)


l = sorted([int(i) for i in input().split()])
print(max(l[2] - l[1] - l[0] + 1, 0))


(a, b, c) = [int(i) for i in input().split()]
t = 0
while True:
	if a + b > c:
		if b + c > a:
			if a + c > b:
				break
			elif a < b + c:
				a += 1
				t += 1
			elif c < a + b:
				c += 1
				t += 1
		elif b < a + c:
			b += 1
			t += 1
		elif c < a + b:
			c += 1
			t += 1
	elif a < b + c:
		a += 1
		t += 1
	elif b < a + c:
		b += 1
		t += 1
print(t)


(a, b, c) = map(int, input().split())
li = [a, b, c]
li.sort()
if li[0] + li[1] <= li[2]:
	print(li[2] - (li[0] + li[1]) + 1)
else:
	print(0)


l = input().split(' ')
a = int(l[0])
b = int(l[1])
c = int(l[2])
m = max(a, b, c)
d = a + b + c - m
if d > m:
	print(0)
else:
	print(m - d + 1)


list1 = []
list1 = input().split()
a = []
i = 0
while i < 3:
	m = int(list1[i])
	a.append(m)
	i += 1
a.sort()
if a[0] + a[1] > a[2]:
	print('0')
	print('\n')
else:
	print(a[2] - (a[0] + a[1]) + 1)
	print('\n')


L = [int(x) for x in input().split()]
L.sort()
(a, b, c) = L
n = 0
while c >= a + b:
	n += 1
	c -= 1
print(n)


list1 = [int(x) for x in input().split()]
a = max(list1)
list1.remove(a)
b = list1[0]
c = list1[1]
ans = a - b - c
if ans > -1:
	print(ans + 1)
else:
	print(0)


(a, b, c) = map(int, input().split())
min_s = min(a, b, c)
max_s = max(a, b, c)
if min_s + (a + b + c - min_s - max_s) <= max_s:
	print(2 * max_s + 1 - (a + b + c))
else:
	print(0)


def main():
	a = [int(x) for x in input().split()]
	a.sort()
	if a[2] >= a[1] + a[0]:
		print(a[2] + 1 - a[1] - a[0])
	else:
		print(0)
main()


tri = list(map(int, input().split()))
d = sum(tri) - max(tri)
if max(tri) >= d:
	print(max(tri) - d + 1)
else:
	print(0)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(a, b, c) = LI()
	(a, b, c) = sorted([a, b, c])
	if a + b > c:
		return 0
	return c - (a + b) + 1
print(main())


number = input().split()
number = [int(item) for item in number]
maxNumber = max(number)
minNumber = min(number)
number.remove(maxNumber)
number.remove(minNumber)
average = number[0]
final = 0
if minNumber + average <= maxNumber:
	final = abs(minNumber + average - maxNumber) + 1
print(final)


(x, y, z) = [int(x) for x in input().split()]
c = max(x, y, z)
if c < x + y + z - c:
	time = 0
else:
	time = 2 * max(x, y, z) - x - y - z + 1
print(time)


q = list(map(int, input().split()))
q.sort()
d = q[0] + q[1]
if d > q[2]:
	print('0')
else:
	print(q[2] + 1 - q[0] - q[1])


l = list(map(int, input().split()))
l = sorted(l)
if l[0] + l[1] > l[2]:
	print('0')
elif l[0] + l[1] == l[2]:
	print('1')
elif l[0] + l[1] < l[2]:
	a = l[2] + 1
	b = l[0] + l[1]
	print(a - b)


s = list(map(int, input().split()))
a = s[0]
b = s[1]
c = s[2]
if s.count(max(s)) > 1:
	print(0)
elif a > b and a > c:
	if a >= b + c:
		print(a - (b + c) + 1)
	else:
		print(0)
elif b > a and b > c:
	if b >= a + c:
		print(b - (a + c) + 1)
	else:
		print(0)
elif c > b and c > a:
	if c >= b + a:
		print(c - (b + a) + 1)
	else:
		print(0)


(a, b, c) = map(int, input().split())
maxx = max(a, b, c)
minn = min(a, b, c)
midd = a + b + c - maxx - minn
s = maxx - minn - midd + 1
if s > 0:
	print(s)
else:
	print(0)


import sys
import math
import bisect

def main():
	A = list(map(int, input().split()))
	A.sort()
	if A[0] + A[1] > A[2]:
		print(0)
	else:
		ans = A[2] + 1 - A[0] - A[1]
		print(ans)
main()


n = list(map(int, input().split()))
n.sort()
print(max(0, n[2] - (n[0] + n[1] - 1)))


maket = lambda l: max(0, (max(l) << 1) + 1 - sum(l))
print(maket(list(map(int, input().split()))))


lens = [int(e) for e in input().split()]
lens = sorted(lens)
print(max(lens[2] - (lens[1] + lens[0]) + 1, 0))


arr = []
x = input().split()
for i in x:
	arr.append(int(i))
arr.sort()
a = arr[0]
b = arr[1]
c = arr[2]
print(max(0, c - (a + b - 1)))


side = [int(j) for j in input().split(' ')]
side.sort()
if side[2] >= side[1] + side[0]:
	print(side[2] - side[1] - side[0] + 1)
else:
	print('0')


def triangle(a, b, c):
	(x, y) = (max(a, max(b, c)), min(a, min(b, c)))
	z = a + b + c - x - y
	if x >= y + z:
		return x + 1 - z - y
	return 0
(A, B, C) = [int(i) for i in input().split()]
print(triangle(A, B, C))


first = list(map(int, input().split()))
minute = 0
while not first[0] < first[1] + first[2] or not first[1] < first[0] + first[2] or (not first[2] < first[0] + first[1]):
	if not first[0] < first[1] + first[2]:
		first[first.index(min(first[1], first[2]))] += 1
		minute += 1
	if not first[1] < first[0] + first[2]:
		first[first.index(min(first[0], first[2]))] += 1
		minute += 1
	if not first[2] < first[0] + first[1]:
		first[first.index(min(first[0], first[1]))] += 1
		minute += 1
print(minute)


(a, b, c) = input().split(' ')
(a, b, c) = (int(a), int(b), int(c))
(a, b, c) = (min(a, b, c), a + b + c - min(a, b, c) - max(a, b, c), max(a, b, c))
ans = 0
while a + b <= c:
	ans += 1
	a += 1
print(ans)


(x, y, max_) = sorted([int(i) for i in input().split(' ')])
required_length = max_ - x + 1
print(max(required_length - y, 0))


x = list(map(int, input().split()))[:3]
x.sort()
k = 0
while x[0] + x[1] <= x[2]:
	x[0] = x[0] + 1
	k = k + 1
while x[0] + x[1] <= x[2]:
	x[1] = x[1] + 1
	k = k + 1
print(k)


def ans(arr):
	arr.sort()
	(a, b, c) = (arr[0], arr[1], arr[2])
	if a + b > c:
		return 0
	cnt = 0
	while a + b <= c:
		a += 1
		cnt += 1
	return cnt
abc = list(map(int, input().strip().split()))
print(ans(abc))


Sides = [0] * 3
Sides[:3] = map(int, input().split())
Flags = [True] * 3
Summ = 0
while Flags[0] or Flags[1] or Flags[2]:
	Flags[0] = False if Sides[2] + Sides[1] > Sides[0] else True
	Flags[1] = False if Sides[2] + Sides[0] > Sides[1] else True
	Flags[2] = False if Sides[0] + Sides[1] > Sides[2] else True
	for i in range(3):
		if Flags[i]:
			if Sides[(i + 1) % 3] < Sides[(i + 2) % 3]:
				Sides[(i + 1) % 3] += 1
			else:
				Sides[(i + 2) % 3] += 1
			Summ += 1
print(Summ)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
stick = sorted([int(_) for _ in f_input().split()])
f_print(str(max(0, stick[2] - (stick[0] + stick[1] - 1))))


(a, b, c) = map(int, input().split())
k = max(a, b, c) - (a + b + c - max(a, b, c))
if k < 0:
	print(0)
else:
	print(k + 1)


l = list(map(int, input().split(' ')))
l.sort()
[a, b, c] = l
print(max(c + 1 - (a + b), 0))


b = list(map(int, input().split()))
m = b[0]
a = 0
for i in range(3):
	if b[i] > m:
		m = b[i]
		a = i
ass = 0
for i in range(3):
	if a != i:
		ass = ass + b[i]
if ass > m:
	print('0')
else:
	print(m - ass + 1)


(a, b, c) = [int(x) for x in input().split()]
mini = min(a, b, c)
maxi = max(a, b, c)
mid = a + b + c - mini - maxi
if maxi >= mid + mini:
	print(maxi + 1 - mini - mid)
else:
	print(0)


(a, b, c) = map(int, input().split())
s = sorted([a, b, c])
d = s[0] + s[1]
f = s[2]
if f >= d:
	print(f - d + 1)
elif f < d:
	print(0)


yeh = [int(a) for a in input().split()]
target = yeh.pop(yeh.index(max(yeh)))
centi = 0
value = sum(yeh)
while value <= target:
	centi += 1
	value += 1
print(centi)


lst = list(map(int, input().split()))
m = max(lst)
if sum(lst) - m > m:
	print(0)
else:
	print(-sum(lst) + 2 * m + 1)


lst = sorted(map(int, input().split()))
print(max(0, lst[2] - lst[1] - lst[0] + 1))


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

def check_triangle(a, b, c):
	if a + b <= c or a + c <= b or b + c <= a:
		return False
	else:
		return True

def min_count(a, b, c):
	if check_triangle(a, b, c):
		return 0
	minutes = 0
	while True:
		a += 1
		minutes += 1
		if check_triangle(a, b, c):
			return minutes
print(min_count(l[0], l[1], l[2]))


(a, b, c) = map(int, input().split())
l = []
l.append(a)
l.append(b)
l.append(c)
p = max(l)
l.remove(p)
x = sum(l)
if p >= x:
	q = p - x
	print(q + 1)
else:
	print('0')


import math
l = sorted(list(map(int, input().split())))
d = l[2] - l[1] - l[0]
if d >= 0:
	print(d + 1)
else:
	print(0)


lengths = sorted(list(map(int, input().strip().split())))
deficit = lengths[2] - (lengths[0] + lengths[1]) + 1
print(max(0, deficit))


A = [int(x) for x in input().split(' ')]
A.sort()
n = A[2] - (A[0] + A[1])
if n >= 0:
	n += 1
else:
	n = 0
print(n)


USE_STDIO = False
if not USE_STDIO:
	try:
		import mypc
	except:
		pass

def main():
	a = sorted(map(int, input().split(' ')))
	x = a[0] + a[1] - a[2]
	if x > 0:
		print(0)
	else:
		print(-x + 1)
main()


l = list(input().split())
a = int(l[0])
b = int(l[1])
c = int(l[2])
q = [a, b, c]
if a + b > c and b + c > a and (a + c > b):
	print(0)
else:
	r = max(q)
	q.remove(r)
	print(r + 1 - sum(q))


def max(a, b):
	if a > b:
		return a
	return b
read = input().split(' ')
a = int(read[0])
b = int(read[1])
c = int(read[2])
sel = max(a, max(b, c))
print(max(0, 2 * sel + 1 - (a + b + c)))


u = list(map(int, input().split()))
u.sort()
(a, b, c) = u
i = 0
while a + b <= c:
	i += 1
	b += 1
	(a, b) = (max(a, b), min(a, b))
print(i)


l = list(map(int, input().split()))
l.sort()
if l[-1] < l[0] + l[1]:
	print(0)
else:
	print(abs(l[0] + l[1] - 1 - l[-1]))


l1 = [int(i) for i in input().split()]
max_ = max(l1)
if sum(l1) - max_ > max_:
	print(0)
else:
	sum_ = sum(l1) - max_
	ans = max_ - sum_ + 1
	print(ans)


l = input().split()
s = 0
r = 0
maxx = -1
for i in range(3):
	l[i] = int(l[i])
	if l[i] > maxx:
		x = i
		maxx = l[i]
	s += l[i]
if s / 2 - maxx <= 0:
	r = s / 2 + 0.5 - (s - maxx)
print(int(r * 2))


from sys import stdin
(a, b, c) = map(int, stdin.readline().split())
(a, b, c) = sorted((a, b, c))
if c - (a + b) < 0:
	print(0)
else:
	print(1 + (c - (a + b)))


a = [int(i) for i in input().split()]
a = sorted(a)
d = a[len(a) - 1] + 1 - (a[0] + a[1])
if d < 0:
	print(0)
else:
	print(d)


sides = list(map(int, input().split()))
tot = sum(sides) - max(sides)
if max(sides) < tot:
	print(0)
else:
	print(max(sides) - tot + 1)


from math import *
from string import *
from itertools import *
from copy import *
l = list(map(int, input().split()))
a = l[0]
b = l[1]
c = l[2]
s1 = a + b
s2 = b + c
s3 = a + c
ans = -1
semi = (a + b + c) / 2
A = semi * (semi - a) * (semi - b) * (semi - c)
ans = 0
while A <= 0:
	l = sorted(l)
	l[0] += 1
	a = l[0]
	b = l[1]
	c = l[2]
	semi = (a + b + c) / 2
	A = semi * (semi - a) * (semi - b) * (semi - c)
	ans += 1
print(ans)


triangles = input()
lst = [int(i) for i in triangles.split()]
s = sum(lst)
max_value = max(lst)
s2 = s - max_value
delta = max_value - s2
if delta < 0:
	print(0)
else:
	print(delta + 1)


(a, b, c) = map(int, input().split())
ans = 0
if a + b <= c:
	k = c - (a + b)
	ans += k
	ans += 1
elif a + c <= b:
	k = b - (a + c)
	ans += k
	ans += 1
elif b + c <= a:
	k = a - (b + c)
	ans += k
	ans += 1
print(ans)


a = list(map(int, input().split()))
b = max(a)
c = sum(a) - b
if c > b:
	print(0)
else:
	print(b + 1 - c)


from collections import defaultdict
import math
(x, y, z) = map(int, input().split())
if x >= y + z:
	print(x - y - z + 1)
elif y >= x + z:
	print(y - x - z + 1)
elif z >= y + x:
	print(z - y - x + 1)
else:
	print('0')


(a, b, c) = map(int, input().split())
l = [a, b, c]
l.sort()
k = l[2] - l[1] - l[0]
if k < 0:
	print(0)
else:
	print(k + 1)


def main():
	a = sorted(map(int, input().split()))
	x = max(0, a[2] - a[0] - a[1] + 1)
	print(x)
main()


lines = sorted(map(int, input().split()))
print(max(0, lines[2] - lines[1] - lines[0] + 1))


(a, b, c) = map(int, input().split())
x = 0
if a > b and a > c:
	max = a
	s1 = b
	s2 = c
elif b > a and b > c:
	max = b
	s1 = a
	s2 = c
else:
	max = c
	s1 = a
	s2 = b
if max >= s1 + s2:
	print(abs(max - (s1 + s2) + 1))
else:
	print(0)


def answer():
	a = [int(x) for x in input().split()]
	i = 0
	ans = 0
	while i < len(a):
		if a[i] == 0:
			a[i] = 1
			ans += 1
		i += 1
	k = max(2 * a[0] - sum(a), 2 * a[1] - sum(a), 2 * a[2] - sum(a))
	if k >= 0:
		ans += k + 1
	else:
		return ans
	return ans
print(answer())


(a, b, c) = [int(i) for i in input().strip().split(' ')]
if a + b > c and a + c > b and (b + c > a):
	print('0')
else:
	ab_diff = abs(c - (a + b))
	ac_diff = abs(b - (a + c))
	bc_diff = abs(a - (b + c))
	min_diff = ab_diff
	if ac_diff < min_diff:
		min_diff = ac_diff
	if bc_diff < min_diff:
		min_diff = bc_diff
	print(min_diff + 1)


from sys import stdin

def triangle(a, b, c):
	count = 0
	if a + b <= c:
		count = c - (a + b) + 1
	elif a + c <= b:
		count = b - (a + c) + 1
	elif b + c <= a:
		count = a - (b + c) + 1
	else:
		count = 0
	return count
(a, b, c) = map(int, stdin.readline().split())
print(triangle(a, b, c))


a = list(map(int, input().split()))
a.sort()
x = a[0]
y = a[1]
z = a[2] + 1
ans = max(0, z - x - y)
print(ans)


def solve(a, b, c):
	if a + b > c:
		return 0
	return c - a - b + 1
(a, b, c) = sorted(map(int, input().split()[:3]))
print(solve(a, b, c))


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
t = 0
if a + b <= c:
	t = c - (a + b) + 1
elif a + c <= b:
	t = b - (a + c) + 1
elif b + c <= a:
	t = a - (b + c) + 1
print(t)


def check(a, b, c):
	if a + b > c and a + c > b and (b + c > a):
		return True
	else:
		return False
(a, b, c) = map(int, input().split())
ans = 0
while 7:
	if check(a, b, c):
		print(ans)
		exit()
	if a <= b and a <= c:
		a += 1
	elif b <= c and b <= a:
		b += 1
	else:
		c += 1
	ans += 1


x = input().split(' ')
a = int(x[0])
b = int(x[1])
c = int(x[2])
count = 0
while not (a + b > c and a + c > b and (c + b > a)):
	if a == min(a, b, c):
		a += 1
		count += 1
	elif b == min(a, b, c):
		b += 1
		count += 1
	else:
		c += 1
		count += 1
print(count)


sticks = list(map(int, input().split()))
sticks.sort()
if sticks[2] < sticks[0] + sticks[1]:
	print(0)
else:
	print(abs(sticks[2] - (sticks[0] + sticks[1])) + 1)


(a, b, c) = map(int, input().split())
sum = 0
if a > b and a > c:
	m = a
	sum = b + c
elif b > a and b > c:
	m = b
	sum = a + c
else:
	m = c
	sum = a + b
if sum > m:
	print(0)
else:
	print(m - sum + 1)


sides = map(int, input().split())
(a, b, c) = sorted(sides)
ab = a + b
answer = 0
if c >= ab:
	answer = c - ab + 1
print(answer)


p = input().split()
a = int(p[0])
b = int(p[1])
c = int(p[2])
o = 0
cnt = 0
if a + b > c and b + c > a and (c + a > b):
	o = 1
while o == 0:
	if a >= b and a >= c:
		if b > c:
			c += 1
			cnt += 1
		else:
			b += 1
			cnt += 1
	elif b >= a and b >= c:
		if a > c:
			c += 1
			cnt += 1
		else:
			a += 1
			cnt += 1
	elif a > b:
		b += 1
		cnt += 1
	else:
		a += 1
		cnt += 1
	if a + b > c and b + c > a and (c + a > b):
		o = 1
print(cnt)


(a, b, c) = list(map(int, input().split()))
x = max(a, b, c)
z = a + b + c - x
if x >= z:
	print(x - z + 1)
else:
	print(0)


arr = sorted([int(x) for x in input().split()])
print(max(arr[2] - arr[1] - arr[0] + 1, 0))


string = input()
arr = string.split()
fir = int(arr[0])
sec = int(arr[1])
thir = int(arr[2])
res = 1
f_summ = sec + fir + thir
if fir + sec > thir:
	res = res
else:
	fir += thir - fir - sec + 1
if fir + thir > sec:
	res = res
else:
	fir += sec - fir - thir + 1
if sec + thir > fir:
	res = res
else:
	sec += fir - thir - sec + 1
summ = sec + fir + thir
print(summ - f_summ)


a = [int(i) for i in input().split()]
b = min(a)
a.remove(min(a))
c = min(a)
if b + c > max(a):
	print(0)
else:
	print(max(a) - (b + c) + 1)


a = input()
l1 = a.split()
l1 = list(map(int, l1))
l1.sort()
s = l1[-1] - l1[-2]
if s > l1[0]:
	c = s - l1[0] + 1
elif s == l1[0]:
	c = 1
else:
	c = 0
print(c)


import time
l = [int(i) for i in input().split()]
start = time.time()
l.sort()
print(max(0, l[2] + 1 - l[0] - l[1]))
finish = time.time()


(x, y, z) = map(int, input().split())
s = x + y + z
maxi = max(x, y, z)
if s - maxi > maxi:
	print(0)
else:
	print(maxi - (s - maxi) + 1)


(a, b, c) = list(map(int, input().split()))
(a, b, c) = (min(a, b, c), sum([a, b, c]) - max(a, b, c) - min(a, b, c), max(a, b, c))
print(max(0, c - a - b + 1))


a = [int(i) for i in input().strip().split(' ')]
j = 0
a.sort()
area = a[2] - (a[1] + a[0]) + 1
print(max(j, area))


(a, b, c) = map(int, input().split())
l = []
l.append(a)
l.append(b)
l.append(c)
l.sort()
if l[0] + l[1] == l[2]:
	print(1)
elif l[0] + l[1] >= l[2]:
	print(0)
else:
	time = l[2] + 1 - l[1] - l[0]
	print(time)


ls = list(map(int, input().split()))
ls.sort()
a = ls[-1]
b = ls[-2]
c = ls[-3]
if b + c > a:
	print(0)
else:
	print(a + 1 - (b + c))


a = [int(_) for _ in input().split()]
a.sort(reverse=True)
if a[0] - a[1] - a[2] >= 0:
	print(abs(a[0] - a[1] - a[2]) + 1)
else:
	print(0)


A = list(map(int, input().split()))
A.sort()
c1 = 0
c2 = 0
c3 = 0
r = 0
if A[0] + A[1] > A[2]:
	c1 = 1
if A[1] + A[2] > A[0]:
	c2 = 1
if A[2] + A[0] > A[1]:
	c3 = 1
if c1 == 0:
	x = A[2] - (A[0] + A[1]) + 1
	r += x
	c1 = 1
if c2 == 0:
	x = A[0] - (A[2] + A[1]) + 1
	r += x
	c2 = 1
if c3 == 0:
	x = A[1] - (A[0] + A[2]) + 1
	r += x
	c3 = 1
if c1 == 1 and c2 == 1 and (c3 == 1):
	print(r)


tp = str(input()).split()
sisi = [int(tp[0]), int(tp[1]), int(tp[2])]

def cek():
	if sisi[0] + sisi[1] > sisi[2]:
		if sisi[2] + sisi[1] > sisi[0]:
			if sisi[0] + sisi[2] > sisi[1]:
				return True
	return False
i = 0
while not cek():
	i += 1
	sisi.sort()
	sisi[0] += 1
print(i)


list = input()
list1 = []
temp = ''
for i in list:
	if i == ' ':
		list1.append(int(temp))
		temp = ''
	else:
		temp += i
list1.append(int(temp))
flag = False
times = 0
while not flag:
	list1.sort()
	if list1[0] + list1[1] > list1[2]:
		flag = True
	else:
		flag = False
		times += 1
		list1[0] += 1
print(times)


a = input().split()
a[0] = int(a[0])
a[1] = int(a[1])
a[2] = int(a[2])
a = sorted(a)
if a[2] < a[1] + a[0]:
	print(0)
else:
	print(a[2] - (a[1] + a[0]) + 1)


(a, b, c) = map(int, input().split())
p1 = a + b - c
p2 = a + c - b
p3 = b + c - a
r = 1000
if p1 <= 0:
	r = p1
if p2 <= 0:
	r = min(p2, r)
if p3 <= 0:
	r = min(p3, r)
if r == 1000:
	print(0)
else:
	print(-r + 1)


(a, b, c) = sorted(map(int, input().split()))
cnt = 0
g = max(a, b)
h = min(a, b)
while g + h <= c:
	g += 1
	cnt += 1
print(cnt)


arr = sorted([int(x) for x in input().split()])
a = arr[0] + arr[1]
mx = arr[2]
if mx < a:
	print(0)
else:
	print(arr[2] - (arr[0] + arr[1]) + 1)


n = list(map(int, input().split()))
c = 0
n = list(sorted(n))
if n[0] + n[1] <= n[2]:
	c += n[2] - (n[0] + n[1]) + 1
	if n[0] > n[1]:
		n[0] += n[2] - (n[0] + n[1]) + 1
	else:
		n[1] += n[2] - (n[0] + n[1]) + 1
if n[0] + n[2] <= n[1]:
	c += n[1] - (n[2] + n[1]) + 1
	if n[0] > n[2]:
		n[0] += n[1] - (n[2] + n[1]) + 1
	else:
		n[2] += n[1] - (n[2] + n[1]) + 1
if n[2] + n[1] <= n[0]:
	c += n[0] - (n[2] + n[1]) + 1
	if n[2] > n[1]:
		n[2] += n[0] - (n[2] + n[1]) + 1
	else:
		n[1] += n[0] - (n[2] + n[1]) + 1
print(c)


(a1, b1, c1) = list(map(int, input().split()))

def middleOfThree(a, b, c):
	x = a - b
	y = b - c
	z = a - c
	if x * y > 0:
		return b
	elif x * z > 0:
		return c
	else:
		return a
a = min(a1, b1, c1)
b = middleOfThree(a1, b1, c1)
c = max(a1, b1, c1)
if a + b > c:
	print(0)
else:
	print(c - a - b + 1)


(a, b, c) = map(int, input().split())
minim = min([a, b, c])
maxim = max([a, b, c])
mid = a + b + c - minim - maxim
print(max(maxim - minim - mid + 1, 0))


d = list(map(int, input().split()))
max = max(d)
l = d
l.remove(max)
if l[0] + l[1] > max:
	print(0)
else:
	print(max - l[1] - l[0] + 1)


x = list(map(int, input().split()))
x.sort()
print(max(0, x[2] - x[1] - x[0] + 1))


a = [int(i) for i in input().split()]
a1 = a[0]
a2 = a[1]
a3 = a[2]
if (a1 + a2 > a3) & (a1 + a3 > a2) & (a2 + a3 > a1):
	print(0)
elif a1 + a2 <= a3:
	print(a3 - a2 - a1 + 1)
elif a1 + a3 <= a2:
	print(a2 - a1 - a3 + 1)
elif a2 + a3 <= a1:
	print(a1 - a3 - a2 + 1)


lis = list(map(int, input().split()))
lis.sort()
value = lis[2] - (lis[0] + lis[1]) + 1
if value <= 0:
	print(0)
else:
	print(value)


def main():
	l1 = []
	st = input('')
	l1 = st.split()
	mayor = 0
	a = b = c = 0
	a = int(l1[0])
	b = int(l1[1])
	c = int(l1[2])
	menor1 = 0
	menor2 = 0
	contador = 0
	if a >= c:
		mayor = a
	else:
		mayor = c
	if b >= mayor:
		mayor = b
	if mayor == b:
		menor1 = a
		menor2 = c
	elif mayor == a:
		menor1 = b
		menor2 = c
	elif mayor == c:
		menor1 = a
		menor2 = b
	for x in range(mayor):
		if menor1 + menor2 > mayor:
			print(contador)
			return
		else:
			menor1 += 1
			contador += 1
main()


k = list(map(int, input().split()))
k.sort()
print(max(0, k[2] - k[1] - k[0] + 1))


def min_time_for_triangle(a, b, c):
	if a + b > c and a + c > b and (b + c > a):
		return 0
	elif not a + b > c:
		return c - (a + b) + 1
	elif not a + c > b:
		return b - (a + c) + 1
	elif not b + c > a:
		return a - (b + c) + 1
(a, b, c) = list(map(int, input().split()))
print(min_time_for_triangle(a, b, c))


(a, b, c) = map(int, input().split())
for i in range(10 ** 5):
	if a + b > c and b + c > a and (a + c > b):
		print(i)
		break
	elif a == min(a, b, c):
		a += 1
	elif b == min(a, b, c):
		b += 1
	else:
		c += 1


n = list(map(int, input().split()))
n.sort()
s = n[0] + n[1]
q = n[2]
if s > q:
	print('0')
if q >= s:
	x = q - s + 1
	print(x)


L = sorted(list(map(int, input().split(' '))))
m = 0
S = sum(L[:2])
if S <= L[-1]:
	m = L[-1] - S + 1
print(m)


f = lambda : map(int, input().split())
t = list(f())
inc = 0
(a, b, c) = (t[0], t[1], t[2])
if a + b <= c:
	inc += c - a - b + 1
(a, c) = (c, a)
if a + b <= c:
	inc += c - a - b + 1
(b, c) = (c, b)
if a + b <= c:
	inc += c - a - b + 1
print(inc)


(a, b, c) = [int(x) for x in input().split()]
(a, b, c) = sorted((a, b, c))
res = 0
while a + b <= c:
	if a < b:
		a += 1
	else:
		b += 1
	res += 1
print(res)


(a, b, c) = map(int, input().split())
if a + b > c and a + c > b and (b + c > a):
	print(0)
elif a >= b + c:
	print(abs(a - (b + c) + 1))
elif b >= a + c:
	print(abs(b - (a + c) + 1))
elif c >= a + b:
	print(abs(c - (a + b) + 1))


ls = list(map(int, input().split()))
ls.sort()
print(max(ls[2] - (ls[0] + ls[1]) + 1, 0))


a = [0] * 3
(a[0], a[1], a[2]) = (int(x) for x in input().split())
a.sort()
print(max(a[2] - a[1] - a[0] + 1, 0))


def ok(arr1):
	arr1.sort()
	if arr1[2] - arr1[0] - arr1[1] < 0:
		return 0
	else:
		return arr1[2] - arr1[0] - arr1[1] + 1
arr1 = list(map(int, input().split()))
print(ok(arr1))


els = list(map(int, input().split()))

def check(els):
	(a, b, c) = els
	return a < b + c and b < a + c and (c < a + b)
c = 0
while not check(els):
	els.sort()
	els[0] += 1
	c += 1
print(c)


e = list(map(int, input().split()))
e.sort()
r = e[2] - e[1] - e[0] + 1
print((r, 0)[r < 0])


(a, b, c) = list(map(int, input().split()))
answer = 0
if a + b <= c:
	answer += c - a - b + 1
elif a + c <= b:
	answer += b - c - a + 1
elif b + c <= a:
	answer += a - b - c + 1
print(answer)


s = input().split()
d = []
d.append(int(s[0]))
d.append(int(s[1]))
d.append(int(s[2]))
d.sort()
d.reverse()
a = d[0]
b = d[1]
c = d[2]
e = c
if a < b + c and b < a + c and (c < a + b):
	print(0)
	exit(0)
while a >= b + c or b >= a + c or c >= a + b:
	c += 1
print(c - e)


a = list(map(int, input().split()))
x = a[0] - a[1] - a[2]
y = a[1] - a[0] - a[2]
z = a[2] - a[1] - a[0]
b = max(x, y, z)
if b < 0:
	print('0')
else:
	print(b + 1)


def valid(sides):
	if sides[0] + sides[1] > sides[2] and sides[1] + sides[2] > sides[0] and (sides[0] + sides[2] > sides[1]):
		return True
	else:
		return False
sides = list(map(int, input().split()))
minutes = 0
while not valid(sides):
	minpos = sides.index(min(sides))
	sides[minpos] += 1
	minutes += 1
print(minutes)


(a, b, c) = map(int, input().split())
x = max(a, b, c)
z = min(a, b, c)
y = a + b + c - (x + z)
t = 0
while y + z <= x:
	y += 1
	t += 1
print(t)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
li = sorted(get_list())
print(max(0, li[2] - li[0] - li[1] + 1))


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


s = input()
s = s.split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
if a + b > c and a + c > b and (b + c > a):
	print('0')
	exit(0)
ct = []
if a + b <= c:
	x = c + 1 - (a + b)
	ct.append(x)
if a + c <= b:
	x = b + 1 - (a + c)
	ct.append(x)
if b + c <= a:
	x = a + 1 - (c + b)
	ct.append(x)
print(min(ct))


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
A = [int(x) for x in input().split()]
A.sort()
print(max(0, A[2] - A[0] - A[1] + 1))


arr = list(map(int, input().split()))
arr.sort()
print(max(0, arr[2] - (arr[0] + arr[1]) + 1))


a = [int(x) for x in input().split()]
a.sort()
ans = 0
if a[0] + a[1] <= a[2]:
	ans = a[2] - (a[0] + a[1]) + 1
print(ans)


input_array = [int(i) for i in input().strip().split()]
input_array.sort()
if input_array[0] + input_array[1] > input_array[2]:
	print(0)
else:
	ans = input_array[0] + input_array[1]
	ans = input_array[2] - ans + 1
	print(ans)


(x, y, z) = [int(x) for x in input().split()]
m = max(x, y, z)
s = x + y + z - m
print(max(0, m - s + 1))


(a, b, c) = tuple(map(int, input().split()))
count_m = 0
if a + b <= c:
	while a + b <= c:
		if a < b:
			a += 1
			count_m += 1
		else:
			b += 1
			count_m += 1
if a + c <= b:
	while a + c <= b:
		if a < c:
			a += 1
			count_m += 1
		else:
			c += 1
			count_m += 1
if b + c <= a:
	while c + b <= a:
		if c < b:
			c += 1
			count_m += 1
		else:
			b += 1
			count_m += 1
print(count_m)


def trainge(arr):
	arr.sort()
	smolest = arr.pop(0)
	smoler = arr.pop(0)
	suma = smoler + smolest
	if suma > arr[0]:
		return 0
	else:
		return abs(arr[0] - suma) + 1
x = list(map(int, input().rstrip().split()))
print(trainge(x))


(a, b, c) = tuple(map(int, input().split()))
sum_smaller_two = a + b + c - max(a, b, c)
if sum_smaller_two <= max(a, b, c):
	print(1 + max(a, b, c) - sum_smaller_two)
else:
	print(0)


(a, b, c) = sorted(list(map(int, input().split())))
print(max(0, c - (a + b) + 1))


(a, b, c) = [int(x) for x in input().split()]
s = [None] * 3
t = 0
medi = 0
if b + c > a > abs(b - c) and a + b > c > abs(a - b) and (a + c > b > abs(a - c)):
	print('0')
else:
	s = sorted([a, b, c])
	res = s[2] + 1 - (s[0] + s[1])
	print(res)


s = list(map(int, input().split()))
c = max(s)
if sum(s) - c > c:
	print(0)
else:
	print(2 * c + 1 - sum(s))


a = input() + ' '
(b, i) = ('', 0)
A = []
for j in range(len(a)):
	if a[j] == ' ':
		A.append(int(b))
		b = ''
	else:
		b += a[j]
if A[0] >= A[1] + A[2]:
	i = i + (A[0] - A[1] - A[2]) + 1
if A[1] >= A[0] + A[2]:
	i = i + (A[1] - A[0] - A[2]) + 1
if A[2] >= A[1] + A[0]:
	i = i + (A[2] - A[1] - A[0]) + 1
print(i)


a = [int(x) for x in input().split()]
smallest = min(a)
largest = max(a)
middle = sum(a) - smallest - largest
needed = largest - (smallest + middle) + 1
if needed <= 0:
	print(0)
else:
	print(needed)


(a, b, c) = map(int, input().split(' '))
m = max(a, b, c)
n = a + b + c
d = n - m
if a + b > c and b + c > a and (c + a > b) or a == b == c:
	print('0')
else:
	print(m - d + 1)


(a, b, c) = map(int, input().split())
largestSide = max(a, b, c)
print(max(largestSide - (a + b + c - 1 - largestSide), 0))


(a, b, c) = map(int, input().split())
z = 0
while a + b <= c or a + c <= b or b + c <= a:
	if a + b <= c:
		if a < b:
			a += 1
		else:
			b += 1
	if a + c <= b:
		if a < c:
			a += 1
		else:
			c += 1
	if c + b <= a:
		if c < b:
			c += 1
		else:
			b += 1
	z += 1
print(z)


l = list(map(int, input().split()))
for i in range(len(l)):
	for j in range(len(l)):
		if l[i] < l[j]:
			temp = l[i]
			l[i] = l[j]
			l[j] = temp
if l[2] - (l[1] + l[0]) < 0:
	print('0')
else:
	print(str(l[2] - (l[1] + l[0]) + 1))


A = list(map(int, input().split()))
A = sorted(A)
print(max(0, A[2] - A[0] - A[1] + 1))


x = [int(x0) for x0 in input().split()]
a = max(x[0], x[1], x[2])
c = x[0] + x[1] + x[2]
print(max(0, 2 * a + 1 - c))


(a, b, c) = list(map(int, input().split()))
res = 0
if a + b <= c:
	if a >= b:
		while a + b <= c:
			a += 1
			res += 1
	else:
		while a + b <= c:
			b += 1
			res += 1
if a + c <= b:
	if a >= c:
		while a + c <= b:
			a += 1
			res += 1
	else:
		while a + c <= b:
			c += 1
			res += 1
if c + b <= a:
	if c >= b:
		while c + b <= a:
			c += 1
			res += 1
	else:
		while c + b <= a:
			b += 1
			res += 1
print(res)


from sys import stdin, stdout
arr = list(map(int, stdin.readline().split()))
arr.sort()
SUM = arr[0] + arr[1]
if SUM > arr[2]:
	print(0)
else:
	print(arr[2] - SUM + 1)


l = sorted(map(int, input().split()))
d = l[-1] - sum(l[:-1])
print(0 if d < 0 else d + 1)


(a, b, c) = map(int, input().split())
if a + b > c and a + c > b and (b + c > a):
	print(0)
else:
	k = 0
	s = sorted([a, b, c])
	print(s[2] - (s[0] + s[1]) + 1)


(a, b, c) = map(int, input().split())
k = a - b - c
k1 = b - a - c
k2 = c - a - b
k3 = max(k, k1)
k4 = max(k3, k2)
if k4 + 1 > 0:
	print(k4 + 1)
else:
	print(0)


def time_req(a, b, c, t):
	m1 = min(a, b, c)
	m2 = max(a, b, c)
	m3 = a + b + c - m1 - m2
	if m1 + m3 > m2:
		return t
	else:
		return time_req(m1 + 1, m2, m3, t + 1)
(a, b, c) = str(input()).split()
(a, b, c) = (int(a), int(b), int(c))
print(time_req(a, b, c, 0))


angka = input().split()
a = int(angka[0])
b = int(angka[1])
c = int(angka[2])
if (a >= b >= c or a >= c >= b) and b + c <= a:
	hasil = a - b - c + 1
elif (b >= a >= c or b >= c >= a) and a + c <= b:
	hasil = b - a - c + 1
elif (c >= b >= a or c >= a >= b) and b + a <= c:
	hasil = c - b - a + 1
else:
	hasil = 0
print(hasil)


(a, b, c) = map(int, input().split())
res = 0
while a >= b + c:
	res += 1
	a -= 1
while b >= a + c:
	res += 1
	b -= 1
while c >= a + b:
	res += 1
	c -= 1
print(res)


l = [int(i) for i in input().split()]
c = max(l)
l.remove(c)
b = max(l)
l.remove(b)
a = l[0]
k = 0
while c >= a + b:
	b += 1
	k += 1
print(k)


lens = list(map(int, input().strip().split()))
lens.sort()
print(max(lens[-1] - (lens[0] + lens[1] - 1), 0))


def getInts():
	return [int(n) for n in input().split()]
sides = getInts()
sides.sort()
if sides[0] + sides[1] > sides[2]:
	print(0)
else:
	print(sides[2] - (sides[0] + sides[1]) + 1)


inp = str(input()).split(' ')
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
max = a
if b > max:
	max = b
if c > max:
	max = c
count = 0
if max == a:
	if b + c <= a:
		while b + c <= a:
			b += 1
			count += 1
if max == b:
	if a + c <= b:
		while a + c <= b:
			a += 1
			count += 1
if max == c:
	if a + b <= c:
		while a + b <= c:
			a += 1
			count += 1
print(int(count))


def triangles():
	(a, b, c) = list(map(int, input().split()))
	diff1 = a + b - c
	diff2 = a + c - b
	diff3 = b + c - a
	biggestDiff = min(diff1, diff2, diff3)
	if biggestDiff <= 0:
		print(abs(biggestDiff) + 1)
	else:
		print(0)
triangles()


def result():
	(a, b, c) = map(int, input().split())
	s = (a + b + c) / 2.0
	minutes = 0
	while s - a <= 0 or s - b <= 0 or s - c <= 0:
		minutes += 1
		s = (a + b + c + minutes) / 2.0
	return minutes
print(result())


a = [int(x) for x in input().split()]
a.sort()
t = 0
while a[0] <= a[2] - a[1]:
	a[0] += 1
	t += 1
print(t)


(a, b, c) = map(int, input().split())
s = 0
if a + b <= c:
	s += c - (a + b - 1)
if a + c <= b:
	s += b - (a + c - 1)
if b + c <= a:
	s += a - (b + c - 1)
print(s)


(a, b, c) = list(map(int, input().split()))
needed = 0
if a + b - c <= 0:
	needed += -(a + b - c - 1)
if a + c - b <= 0:
	needed += -(a + c - b - 1)
if b + c - a <= 0:
	needed += -(b + c - a - 1)
print(needed)


lengths = list(map(int, input().split()))
temp = 0
(a, b, c) = lengths
if a + b > c:
	temp += 1
if b + c > a:
	temp += 10
if c + a > b:
	temp += 100
if temp == 111:
	print(0)
elif temp == 11:
	print(b - (c + a) + 1)
elif temp == 110:
	print(c - (a + b) + 1)
elif temp == 101:
	print(a - (b + c) + 1)


import sys

def rint():
	return map(int, sys.stdin.readline().split())
side = list(rint())
side.sort()
print(max(0, side[2] - (side[1] + side[0]) + 1))


while True:
	try:
		(a, b, c) = map(int, input().split())
	except:
		break
	sum = a + b + c - max(a, b, c)
	themax = max(a, b, c)
	if themax < sum:
		print(0)
	else:
		print(themax - sum + 1)


sizes = list(map(int, input().split(' ')))
sizes.sort(reverse=True)
if sizes[1] + sizes[2] > sizes[0]:
	print(0)
else:
	print(sizes[0] - (sizes[1] + sizes[2]) + 1)


s = [int(i) for i in input().split()]
ma = max(s[0], s[1], s[2])
s.remove(ma)
print(max(0, ma - (s[0] + s[1]) + 1))


def main():
	aika = 0
	sivut = input()
	splitatut = sivut.split()
	sivulista = []
	for sivu in splitatut:
		sivulista.append(int(sivu))
	sivulista = sorted(sivulista)
	while sivulista[0] + sivulista[1] <= sivulista[2]:
		aika += 1
		sivulista[1] += 1
	print(aika)
main()


import sys
a = list(map(int, input().split()))
for i in range(3):
	if a[i] >= a[(i + 1) % 3] + a[(i + 2) % 3]:
		print(a[i] + 1 - a[(i + 1) % 3] - a[(i + 2) % 3])
		sys.exit()
print(0)


(n, m, k) = map(int, input().split())
val = max(n, m, k)
val2 = n + m + k - val
if val2 > val:
	print(0)
else:
	print(val - val2 + 1)


l = list(map(int, input().split()))
m = 0
while not (l[0] + l[1] > l[2] and l[1] + l[2] > l[0] and (l[0] + l[2] > l[1])):
	m += 1
	l.sort()
	l[0] += 1
print(m)


import os
import sys
listt = [int(n) for n in input().split()]
maxim = max(listt)
listt.remove(maxim)
min1 = listt[0]
min2 = listt[1]
if min1 + min2 > maxim:
	print(0)
else:
	pidar = maxim - min1 - min2 + 1
	print(pidar)


(a, b, c) = list(map(int, input().split()))

def valid(a, b, c):
	return a + b > c and a + c > b and (b + c > a)
n = 100
for i in range(n + 1):
	for j in range(n + 1):
		for k in range(n + 1):
			if valid(a + i, b + j, c + k):
				print(i + j + k)
				exit(0)
print(0)


a = list(map(int, input().split()))
count = 0
while True:
	a.sort()
	if a[0] + a[1] > a[2] and a[1] + a[2] > a[0] and (a[0] + a[2] > a[1]):
		break
	else:
		a[0] += 1
		count += 1
		a.sort()
print(count)


(a, b, c) = (0, 0, 0)
while (int(a) > 100 or int(a) < 1) or (int(b) > 100 or int(b) < 1) or (int(c) > 100 or int(c) < 1):
	(a, b, c) = input().split()
(a, b, c) = (int(a), int(b), int(c))
if a >= b + c:
	print(a - (b + c) + 1)
elif b >= a + c:
	print(b - (a + c) + 1)
elif c >= a + b:
	print(c - (a + b) + 1)
else:
	print('0')


s = [int(n) for n in input().split()]
s.sort()
if s[0] + s[1] > s[2]:
	print(0)
elif s[0] + s[1] == s[2]:
	print(1)
else:
	l = s[2] - (s[0] + s[1]) + 1
	print(l)


def check(a, b, c):
	if a + b > c and a + c > b and (b + c > a):
		return True
	return False
arr = list(input().split(' '))
arr = list((int(x) for x in arr))
arr = sorted(arr)
res = 0
(a, b, c) = (arr[0], arr[1], arr[2])
while not check(arr[0], arr[1], arr[2]):
	arr[1] += 1
	res += 1
print(res)


(a, b, c) = map(int, input().split())
c1 = c - (a + b) + 1
b1 = b - (a + c) + 1
a1 = a - (b + c) + 1
d = max(a1, b1, c1, 0)
print(d)


(a, b, c) = map(int, input().strip().split(' '))
min = 0
if a + b <= c:
	min = min + c + 1 - a - b
	a = a + min
if b + c <= a:
	min = min + a + 1 - b - c
	c = c + min
if c + a <= b:
	min = min + b + 1 - a - c
	a = a + min
print(min)


temp = input()
a = temp.split()
List = []
for x in a:
	List.append(int(x))
List.sort()
ans = List[2] - (List[1] + List[0]) + 1
if ans < 0:
	ans = 0
print(ans)


(a, b, c) = [int(x) for x in input().split()]
m = max([a, b, c])
print(max(0, 2 * m - a - b - c + 1))


import sys
input = sys.stdin.readline
l = list(map(int, input().split()))
l.sort()
if l[0] + l[1] > l[2]:
	print(0)
else:
	print(l[2] - l[1] - l[0] + 1)


(a, b, c) = map(int, input().split())
t = a + b + c
c = max(a, b, c)
a = min(a, b, c)
b = t - (a + c)
print(max(0, c - (a + b - 1)))


lst = list(map(int, input().split()))
lst.sort()
smallerTwo = lst[0] + lst[1]
if smallerTwo > lst[2]:
	print(0)
else:
	print(lst[2] - smallerTwo + 1)


(a, b, c) = list(map(int, input().split()))
s = max(a, b, c)
if s == a:
	if b + c > a:
		print(0)
	else:
		print(a + 1 - b - c)
elif s == b:
	if a + c > b:
		print(0)
	else:
		print(b + 1 - a - c)
elif a + b > c:
	print(0)
else:
	print(c + 1 - a - b)


input_arr = list(map(int, input().split(' ')))
input_arr.sort()
if input_arr[0] + input_arr[1] > input_arr[2]:
	print(0)
else:
	print(input_arr[2] - (input_arr[0] + input_arr[1]) + 1 or 1)


l = [int(x) for x in input().split()]
m = max(l)
l.remove(m)
c = m - sum(l)
if c < 0:
	print(0)
else:
	print(c + 1)


(ra, rb, rc) = map(int, input().split())
a = min(ra, rb, rc)
c = max(ra, rb, rc)
b = ra + rb + rc - a - c
if a + b > c:
	print(0)
else:
	print(c + 1 - a - b)


(a, b, c) = map(int, input().split())
m1 = 0
while a + b <= c:
	a = a + 1
	m1 = m1 + 1
	if a == 100:
		b = b + 1
while a + c <= b:
	a = a + 1
	m1 = m1 + 1
	if a == 100:
		c = c + 1
while b + c <= a:
	b = b + 1
	m1 = m1 + 1
	if b == 100:
		c = c + 1
print(m1)


q = input().split(' ')
a = int(q[0])
s = int(q[1])
d = int(q[2])
if a >= s + d:
	print(a - (s + d) + 1)
elif s >= a + d:
	print(s - a - d + 1)
elif d >= s + a:
	print(d - a - s + 1)
else:
	print(0)


l = list(map(int, input().split()))
l.sort()
(a, b, c) = (l[0], l[1], l[2])
if a + b > c and a + c > b and (c + b > b):
	print(0)
else:
	print(c - b - a + 1)


(k, i) = (0, 0)
a = [int(i) for i in input().split()]
a = sorted(a)
while not a[2] < a[0] + a[1]:
	if i % 2 == 0:
		a[0] += 1
	else:
		a[1] += 1
	k += 1
print(k)


(a, b, c) = list(map(int, input().split()))
num = int()
judge = True
while judge == True:
	if a + b <= c:
		num = num + 1
		a += 1
	elif a + c <= b:
		num = num + 1
		a += 1
	elif b + c <= a:
		num = num + 1
		b += 1
	else:
		judge = False
print(num)


def solve(a, b, c):
	longest = max(a, b, c)
	return longest * 2 + 1 - a - b - c
(a, b, c) = map(int, input().split(' '))
print(max(0, solve(a, b, c)))


def main():
	(a, b, c) = map(int, input().strip().split())
	d = 0
	if a >= b + c:
		d += a - (b + c) + 1
	if b >= a + c:
		d += b - (a + c) + 1
	if c >= a + b:
		d += c - (a + b) + 1
	print(d)
main()


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


(a, b, c) = [int(i) for i in input().split()]
if max(a, b, c) >= sum([a, b, c]) - max(a, b, c):
	print(2 * max(a, b, c) - sum([a, b, c]) + 1)
else:
	print(0)


x = sorted([int(i) for i in input().split()])
(a, b, c) = (x[0], x[1], x[2])
if a + b > c:
	print(0)
else:
	print(c - a - b + 1)


a = list(map(int, input().split()))
s = sum(a)
l = max(a)
if s - l > l:
	print('0')
else:
	print(2 * l - s + 1)


def check(a, b, c):
	if a + b > c and b + c > a and (c + a > b):
		return 1
	else:
		return 0
n = [int(i) for i in input().split(' ')]
count = 0
x = check(n[0], n[1], n[2])
while x == 0:
	n.sort()
	n[0] += 1
	count += 1
	x = check(n[0], n[1], n[2])
print(count)


(a, b, c) = [int(a) for a in input().split()]
ans = 0

def triangle_check(a, b, c, ans):
	while a + c <= b:
		c = c + 1
		ans = ans + 1
	while a + b <= c:
		a = a + 1
		ans = ans + 1
	while b + c <= a:
		b = b + 1
		ans = ans + 1
	return ans
print(triangle_check(a, b, c, ans))


l = [int(i) for i in input().split()]
m = max(l)
l.remove(m)
s = sum(l)
if s > m:
	print(0)
else:
	print(m - s + 1)


arr = list(map(int, input().split()))
arr.sort()
(a, b, c) = (arr[0], arr[1], arr[2])
sum = a + b
if sum <= c:
	print(c - sum + 1)
else:
	print(0)


a = list(map(int, input().split()))
x = a.pop(a.index(max(a)))
if x < a[0] + a[1]:
	print(0)
else:
	print(x - a[0] - a[1] + 1)


list = map(int, input().split())
list = sorted(list)
ans = list[2] - list[1] - list[0] + 1
if ans <= 0:
	ans = 0
print(ans)


s = input().split()
(a, b, c) = (int(s[0]), int(s[1]), int(s[2]))
x = max(a, b, c) - min(a, b, c) - (a + b + c - max(a, b, c) - min(a, b, c)) + 1
if x < 0:
	print(0)
else:
	print(x)


v = sorted(map(int, input().split()))
print(max(0, v[2] - v[1] - v[0] + 1))


(a, b, c) = map(int, input().split())
minu = 0
if a + b <= c:
	minu += c - a - b + 1
if a + c <= b:
	minu += b - a - c + 1
if b + c <= a:
	minu += a - b - c + 1
print(minu)


(a, b, c) = map(int, input().split())
s1 = a + b
s2 = a + c
s3 = b + c
if s1 == s2 and s2 == s3:
	print('0')
else:
	t = 0
	if s1 <= c:
		t = abs(c - s1) + 1
	elif s2 <= b:
		t = abs(b - s2) + 1
	elif s3 <= a:
		t = abs(a - s3) + 1
	print(t)


arr = list(map(int, input().split()))
maxval = max(arr)
if sum(arr) - maxval > maxval:
	print(0)
else:
	val1 = sum(arr) - maxval
	print(maxval + 1 - val1)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
(a, b, c) = map(int, input().split())
print(max(0, max(a, b, c) * 2 - a - b - c + 1))


arr = list(map(int, input().split()))
arr.sort()
if arr[0] + arr[1] > arr[2]:
	print(0)
elif arr[0] + arr[1] <= arr[2]:
	temp = arr[0] + arr[1]
	print(arr[2] - temp + 1)


_ = sorted(list(map(int, input().split())))
print(max(_[2] - (_[1] + _[0]) + 1, 0))


s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
if a < b and c < b:
	if a + c > b:
		print(0)
	else:
		print(b - (c + a) + 1)
elif b < a and c < a:
	if b + c > a:
		print(0)
	else:
		print(a - (c + b) + 1)
elif a < c and b < c:
	if a + b > c:
		print(0)
	else:
		print(c - (b + a) + 1)
else:
	print(0)


def checktriangle(a, b, c):
	if a + b > c and b + c > a and (a + c > b):
		return True
	else:
		return False
inp = input('')
splt = inp.split()
a = int(splt[0])
b = int(splt[1])
c = int(splt[2])
assert 1 <= a <= 100
assert 1 <= b <= 100
assert 1 <= c <= 100
step = 0
while not checktriangle(a, b, c):
	step += 1
	if min(a, b, c) == a:
		a += 1
	elif min(a, b, c) == b:
		b += 1
	elif min(a, b, c) == c:
		c += 1
print(step)


t = [int(i) for i in input().split()]
t.sort()
(a, b, c) = (t[0], t[1], t[2])
if a + b > c and b + c > a and (a + c > b):
	print(0)
else:
	ans = 0
	if a + b <= c:
		ans += c - a - b + 1
	elif b + c <= a:
		ans += a - b - c + 1
	elif a + c <= b:
		ans += b - a - c + 1
	print(ans)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
Input = sys.stdin.readline
c = get_list()
c.sort()
print(0) if c[2] < c[0] + c[1] else print(c[2] + 1 - (c[0] + c[1]))


c = list(map(int, input().split()))
c.sort()
print(max(0, c[2] - (c[0] + c[1] - 1)))


ip = [int(x) for x in input().split()]
ip = sorted(ip)
ans = 0
while True:
	if ip[1] - ip[0] < ip[2] < ip[0] + ip[1]:
		break
	ip[0] += 1
	ans += 1
	ip = sorted(ip)
print(ans)


import sys
import string
from math import gcd
import getpass
import math
from decimal import Decimal

def ria():
	return [int(i) for i in input().split()]
if getpass.getuser() != 'frohenk':
	filename = 'half'
else:
	sys.stdin = open('input.txt')
(a, b, c) = ria()
i = max(0, min((-a - b + c + 1 if a + b <= c else 10000000, +a - b - c + 1 if b + c <= a else 10000000, -a + b - c + 1 if a + c <= b else 10000000)))
if i == 10000000:
	i = 0
print(i)


def solve(arr):
	sorted_arr = list(sorted(arr))
	min_sum = sorted_arr[0] + sorted_arr[1]
	if min_sum <= sorted_arr[2]:
		return sorted_arr[2] - min_sum + 1
	else:
		return 0

def main():
	arr = list(map(int, input().split()))
	print(solve(arr))
main()


x = input().split()
a = int(x[0])
b = int(x[1])
c = int(x[2])
longest = 0
total = a + b + c
if a >= c and a >= b:
	longest = a
elif b >= c:
	longest = b
else:
	longest = c
diff = 0
while longest >= total - longest:
	total += 1
	diff += 1
print(diff)


lst = list(map(int, input().split()))
lst.sort()
a = lst[0]
b = lst[1]
c = lst[2]
if a + b > c:
	print(0)
else:
	sm = c - (a + b)
	sm += 1
	print(sm)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
maksimum = max(a, b, c)
zbroj = a + b + c - maksimum
if zbroj <= maksimum:
	minute = maksimum - zbroj + 1
else:
	minute = 0
print(minute)


(a, b, c) = map(int, input().split())
k = 0
while a + b <= c:
	a += 1
	k += 1
while a + c <= b:
	c += 1
	k += 1
while c + b <= a:
	b += 1
	k += 1
print(k)


li = [int(i) for i in input().split()]
li.sort(reverse=True)
n = max(0, li[0] - li[1] - li[2] + 1)
print(n)


ar = [int(i) for i in input().split()]
ar.sort()
print(max(0, ar[2] - ar[1] - ar[0] + 1))


list1 = list(map(int, input().split()))
finalval = 0
val = max(list1)
for i in list1:
	finalval += i
finalval -= val
if finalval <= val:
	print(val - finalval + 1)
else:
	print(0)


(a, b, c) = map(int, input().split())
z = max(a, b, c)
s = a + b + c - z
if z < s:
	print(0)
elif z >= s:
	if z == a:
		x = b + c
	elif z == b:
		x = a + c
	else:
		x = a + b
	inc = z - x
	print(inc + 1)


z = input
(a, b, c) = sorted(map(int, z().split()))
s = a + b
t = c - s
print(max(0, t + 1))


def main():
	(a, b, c) = sorted(list(map(int, input().split())))
	cnt = 0
	while a + b <= c:
		cnt += 1
		a += 1
	print(cnt)
main()


l = list(map(int, input().split()))
l.sort()
v = l[0] + l[1]
res = l[2] - v
if res >= 0:
	print(res + 1)
else:
	print('0')


(a, b, c) = map(lambda x: int(x), input().split())
l = sorted([a, b, c])
res = l[-1] - l[0] - l[1] + 1
if res < 0:
	res = 0
print(res)


n = 1
while n:
	n -= 1
	x = list(map(int, input().split(' ')))
	x.sort()
	if x[0] + x[1] > x[2]:
		print(0)
	else:
		print(x[2] - x[1] - x[0] + 1)


s = [int(i) for i in input().split()]
s.sort()
print([0, s[2] - s[0] - s[1] + 1][s[2] - s[0] - s[1] > -1])


(a, b, c) = map(int, input().split())
li = sorted([a, b, c])
if li[0] + li[1] > li[2]:
	print(0)
elif li[0] + li[1] < li[2]:
	print(li[2] - (li[0] + li[1]) + 1)
else:
	print(1)


l = [int(i) for i in input().split()]
l.sort()
maxi = l[2]
s = l[0] + l[1]
if maxi < l[0] + l[1]:
	print(0)
else:
	print(maxi + 1 - l[0] - l[1])


a = list(map(int, input().split()))
x = max(a)
y = sum(a)
z = y - x
if z - x > 0:
	print(0)
elif x == z:
	print(1)
else:
	print(abs(x - z) + 1)


import os
import sys

def is_triangle(x, y, z):
	return x + y > z and y + z > x and (x + z > y)

def make_triangle(a, b, c):
	p1 = 0
	if is_triangle(a, b, c):
		return 0
	while True:
		if is_triangle(a + 1, b, c):
			p1 += 1
			return p1
		if is_triangle(a, b + 1, c):
			p1 += 1
			return p1
		if is_triangle(a, b, c + 1):
			p1 += 1
			return p1
		a += 1
		b += 1
		c += 1
		p1 += 1
	return p1

def solve(a, b, c):
	mins_to_make = make_triangle(a, b, c)
	print(mins_to_make)
(a, b, c) = map(int, input().split())
solve(a, b, c)


import os
import sys
from io import BytesIO, IOBase

def main():
	t = 1
	for _ in range(t):
		coords = list(map(int, input().split()))
		coords.sort()
		(a, b, c) = coords
		diff = c - (a + b)
		print(diff + 1 if diff >= 0 else 0)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


sides = sorted(map(int, input().split()))
print(max(0, sides[-1] + 1 - sides[0] - sides[1]))


(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
tbenhat = 1000
for i in range(a, 151, 1):
	for j in range(b, 151, 1):
		for k in range(c, 151, 1):
			if i + j > k and i + k > j and (j + k > i):
				t = i - a + (j - b) + (k - c)
				if tbenhat > t:
					tbenhat = t
print(tbenhat)


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


from sys import stdin, stdout
(a, b, c) = map(int, stdin.readline().strip().split())
s = [a, b, c]
s.sort()
s = s[::-1]
ans = s[0] - s[1] + 1
ans = max(0, ans - s[-1])
print(ans)


(a, b, c) = [int(x) for x in input().split()]
l = [a, b, c]
if l[0] < l[1]:
	temp = l[0]
	l[0] = l[1]
	l[1] = temp
if l[0] < l[2]:
	temp = l[0]
	l[0] = l[2]
	l[2] = temp
if l[1] + l[2] > l[0]:
	print('0')
else:
	print(l[0] + 1 - (l[1] + l[2]))


triangle = list(map(int, input().split(sep=' ')))
a = triangle[0]
b = triangle[1]
c = triangle[2]
maximum = max(triangle)
triangle.remove(maximum)
time = max(0, maximum - triangle[0] - triangle[1] + 1)
print(time)


(a, b, c) = [int(x) for x in input().split(' ')]
tmp = [a, b, c]
sm1 = min(tmp)
tmp.remove(sm1)
sm2 = min(tmp)
tmp.remove(sm2)
if sm1 + sm2 > tmp[0]:
	print(0)
else:
	print(tmp[0] - sm1 - sm2 + 1)


s = sorted(map(int, input().split()))
print(max(0, s[2] - s[1] - s[0] + 1))


(m, n, k) = map(int, input().split())
a = max(m, n, k)
print(max(0, -m - n - k + a + a + 1))


from math import fabs
arr = list(map(int, input().split()))
arr.sort()
if arr[2] >= arr[1] + arr[0]:
	print(int(fabs(arr[2] - (arr[0] + arr[1])) + 1))
else:
	print(0)


R = lambda : list(map(int, input().split()))
(a, b, c) = R()
if a + b > c:
	temp = abs(a - b)
	if temp < c:
		print('0')
	else:
		print(abs(temp - c) + 1)
else:
	print(c - (a + b) + 1)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
if b > a:
	(a, b) = (b, a)
if c > a:
	(a, c) = (c, a)
if c > b:
	(b, c) = (c, b)
if b + c > a:
	print(0)
else:
	print(a - (c + b) + 1)


lati = sorted([int(x) for x in input().split()])
if lati[0] + lati[1] > lati[2]:
	print('0')
else:
	print(lati[2] - lati[1] - lati[0] + 1)


(a, b, c) = sorted(map(int, input().split()))
n = a + b - c - 1
if n < 0:
	print(abs(n))
else:
	print(0)


(a, b, c) = map(int, input().split(' '))
m0 = min(a, b, c)
m2 = max(a, b, c)
m1 = a + b + c - m0 - m2
print(max(0, m2 - (m1 + m0) + 1))


(a, b, c) = map(int, input().split())
time = 0
len_a = b + c - a
len_b = a + c - b
len_c = a + b - c
if min(len_a, len_b, len_c) > 0:
	print(0)
else:
	print(-min(len_a, len_b, len_c) + 1)


ai = list(map(int, input().split()))
ai.sort()
print(max(0, ai[2] - ai[1] - ai[0] + 1))


(a, b, c) = map(int, input().split())
l1 = [a, b, c]
l1.sort()
(a, b, c) = l1
if a + b > c:
	print(0)
elif a + b + c == 0:
	print(3)
else:
	print(c + 1 - a - b)


from sys import stdin
nums = list(map(int, stdin.readline().split()))
nums.sort()
(a, b, c) = nums
print(0 if a + b > c else c - (a + b) + 1)


L = list(map(int, input().split()))
L.sort()
if L[0] + L[1] > L[2]:
	print(0)
elif L[0] + L[1] == L[2]:
	print(1)
else:
	print(L[2] + 1 - L[0] - L[1])


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	A = Scanner.map_int()
	A.sort()
	print(max(0, A[2] - A[1] - A[0] + 1))

def main():
	solve()
main()


(s, m, l) = sorted([*map(int, input().split())])
print(max(l - s - m + 1, 0))


(a, b, c) = map(int, input().split()[:3])
k = 0
z = []
z.append(a)
z.append(b)
z.append(c)
z.sort()
(a, b, c) = (z[0], z[1], z[2])
while a + b <= c or a + c <= b:
	a += 1
	k += 1
print(k)


a = list(map(int, input().split()))
a.sort(reverse=True)
if a[0] <= a[1] + a[2] - 1:
	print(0)
else:
	print(max(0, a[0] - (a[1] + a[2] - 1)))


l = list(map(int, input().split()))
r = max(l)
l.remove(r)
t = sum(l)
u = t - r
if u > 0:
	print('0')
else:
	print(abs(u) + 1)


def main():
	a = [int(e) for e in input().split()]
	a.sort()
	print(max(a[2] - a[0] - a[1] + 1, 0))
main()


(a, b, c) = map(int, input().split())
ans = 0
if a >= b + c:
	q = min(b, c)
	while a >= q + max(b, c):
		ans += 1
		q += 1
	if b < c:
		b = q
	else:
		c = q
if b >= a + c:
	q = min(a, c)
	while b >= q + max(a, c):
		ans += 1
		q += 1
	if a < c:
		a = q
	else:
		c = q
if c >= b + a:
	q = min(b, a)
	while c >= q + max(a, b):
		ans += 1
		q += 1
	if b < c:
		b = q
	else:
		c = q
print(ans)


(a, b, c) = map(int, input().split())
d = []
d.append(a)
d.append(b)
d.append(c)
po = None
otv = 0
g = 0
for i in range(3):
	g = d[i] - d[(i + 1) % 3] - d[(i + 2) % 3]
	if g >= otv:
		otv = g
		po = 1
if po:
	otv += 1
print(otv)


a = [int(x) for x in input().split()]
a.sort()
k = a[2]
k1 = a[0] + a[1]
if k1 > k:
	print(0)
else:
	print(k - k1 + 1)


s = input()
data = s.split()
(data[0], data[1], data[2]) = (int(data[0]), int(data[1]), int(data[2]))
data.sort()
diff = data[2] - (data[0] + data[1])
if diff < 0:
	print(0)
else:
	print(diff + 1)


import sys

def main():
	(a, b, c) = sorted(map(int, sys.stdin.read().strip().split()))
	return max(c + 1 - a - b, 0)
print(main())


(a, b, c) = map(int, input().split())
mx = max(a, b, c)
print(max(0, 2 * mx - (a + b + c) + 1))


(a, b, c) = list(map(int, input().strip().split()))
d = [a, b, c]
d.sort()
e = d[0] + d[1] - d[2]
if e > 0:
	print(0)
else:
	print(d[2] - d[0] - d[1] + 1)


(a, b, c) = list(map(int, input().split()))
time = 0
d1 = 0
d2 = 0
d3 = 0
if a + b <= c:
	d3 = c - (a + b) + 1
if b + c <= a:
	d1 = a - (c + b) + 1
if a + c <= b:
	d2 = b - (a + c) + 1
print(d1 + d2 + d3)


def check_triangle(a, b, c):
	if a + b > c and a + c > b and (b + c > a):
		return True
	else:
		return False

def find_closest(l1, l2, g):
	return g + 1 - (l1 + l2)
(a, b, c) = map(int, input().split())
if check_triangle(a, b, c):
	print(0)
else:
	(a, b, c) = sorted([a, b, c])
	print(find_closest(a, b, c))


t = list(map(int, input().split()))
t.sort()
print(max(0, t[2] - t[1] - t[0] + 1))


s = list(map(int, input().split()))
s.sort()
print(max(0, s[2] - s[1] - s[0] + 1))


from sys import stdin, setrecursionlimit
from collections import deque
input = stdin.readline
setrecursionlimit(int(200000.0))

def getstr():
	return input()[:-1]

def getint():
	return int(input())

def getints():
	return list(map(int, input().split()))

def getint1():
	return list(map(lambda x: int(x) - 1, input().split()))
jn = lambda x, l: x.join(map(str, l))
MOD = 10 ** 9 + 7
(y, n) = ('YES', 'NO')

def solve():
	x = list(map(int, input().strip().split()))
	(a, b, c) = (x[0], x[1], x[2])
	if a + b > c and b + c > a and (c + a > b):
		print(0)
	else:
		x = sorted(x)
		print(x[2] - (x[0] + x[1]) + 1)
solve()


def ok(a, b, c):
	return a + b > c and a + c > b and (b + c > a)
ch = input().split()
(a, b, c) = (int(ch[0]), int(ch[1]), int(ch[2]))
ans = a + b + c
for i in range(0, 100):
	for j in range(0, 100):
		for k in range(0, 100):
			if ok(a + i, b + j, c + k) == True:
				ans = min(ans, i + j + k)
print(ans)


(a, b, c) = tuple(map(int, input().split()))
edges = (a, b, c)
can_we = True
if a >= b + c:
	can_we = False
elif b >= a + c:
	can_we = False
	edges = (b, a, c)
elif c >= a + b:
	can_we = False
	edges = (c, a, b)
if can_we:
	print(0)
else:
	answer = edges[0] - edges[1] - edges[2] + 1
	print(answer)


arr = list(map(int, input().split()))
c = max(arr)
arr.remove(c)
print(max(0, c - (sum(arr) - 1)))


m = list(map(int, input().split()))
m.sort()
print(max(0, m[-1] + 1 - m[0] - m[1]))


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


ns = [int(x) for x in input().split()]
ns.sort()
if ns[0] + ns[1] > ns[2]:
	print(0)
	quit()
else:
	print(ns[2] + 1 - ns[0] - ns[1])


(a, b, c) = map(int, input().split())
x = max(a, b, c)
y = min(a + b, a + c, b + c)
print(max(x - y + 1, 0))


list1 = [int(v) for v in input().split()]
list1.sort()
if list1[0] + list1[1] > list1[2]:
	print(0)
else:
	print(list1[2] - list1[1] - list1[0] + 1)


ls = sorted(map(int, input().split()))
print(max(0, ls[2] + 1 - ls[1] - ls[0]))


put = input().split()
a = int(put[0])
b = int(put[1])
c = int(put[2])
max_one = max(a, b, c)
out = max_one - (a + b + c - max_one) + 1
if out - 1 < 0:
	out = 0
print(out)


(a, b, c) = map(int, input().split())
l = [a, b, c]
count = 0
while l[0] + l[1] <= l[2] or l[0] + l[2] <= l[1] or l[2] + l[1] <= l[0]:
	j = min(l)
	li = l.index(j)
	l[li] += 1
	count += 1
print(count)


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
l = li()
l.sort()
if l[0] + l[1] > l[2]:
	ans = 0
else:
	ans = l[2] - (l[0] + l[1]) + 1
print(ans)


a = list(map(int, input().split()))
a.sort(reverse=True)
k = a[0] - a[-1] - a[-2] + 1
if k < 0:
	k = 0
print(k)


(a, b, c) = (int(x) for x in input().split())
(a, b, c) = sorted((a, b, c))
i = 0
while a + b <= c:
	a += 1
	i += 1
print(i)


(a, b, c) = map(int, input().split())
(a, b, c) = sorted([a, b, c])
if a + b > c and a + c > b and (c + b > a):
	print(0)
else:
	ans = 0
	while a + b <= c:
		a += 1
		ans += 1
		if a > b:
			(a, b) = (b, a)
	print(ans)


s = input().split()
if int(s[0]) < int(s[1]) + int(s[2]) and int(s[1]) < int(s[0]) + int(s[2]) and (int(s[2]) < int(s[1]) + int(s[0])):
	print(0)
elif int(s[0]) >= int(s[1]) + int(s[2]):
	print(int(s[0]) + 1 - (int(s[1]) + int(s[2])))
elif int(s[1]) >= int(s[0]) + int(s[2]):
	print(int(s[1]) + 1 - (int(s[0]) + int(s[2])))
else:
	print(int(s[2]) + 1 - (int(s[1]) + int(s[0])))


sides = [i for i in map(int, input().split())]
k = 2 * max(sides) + 1 - sum(sides)
print(k if k > 0 else 0)


k = list(map(int, input().split()))
m = 0
if k[0] + k[1] > k[2] and k[1] + k[2] > k[0] and (k[0] + k[2] > k[1]):
	print('0')
else:
	m = max(k[0], k[1])
	m = max(m, k[2])
	print(2 * m - k[0] - k[1] - k[2] + 1)


(a, b, c) = map(int, input().split())
l = [a, b, c]
l.sort()
a2 = l[0]
b2 = l[1]
c2 = l[2]
if a2 + b2 > c2:
	print(0)
else:
	ans = c2 + 1 - (a2 + b2)
	print(ans)


l = [int(i) for i in input().split()]
l.sort()
d = l[2] - (l[0] + l[1])
if d < 0:
	print(0)
else:
	print(d + 1)


import sys
(a, b, c) = map(int, sys.stdin.readline().split())
largest = 0
diff = 0
if a > b and a > c:
	largest = a
	if b + c <= largest:
		diff = largest - (b + c) + 1
		print(diff)
	else:
		print(0)
elif b > a and b > c:
	largest = b
	if a + c <= largest:
		diff = largest - (a + c) + 1
		print(diff)
	else:
		print(0)
else:
	largest = c
	if a + b <= largest:
		diff = largest - (a + b) + 1
		print(diff)
	else:
		print(0)


(a, b, c) = map(int, input().split())
l1 = 0
l2 = 0
l3 = 1
if a > b and a > c:
	l1 = a
	l2 = b + c
	(a1, a2) = (b, c)
elif b > c and b > a:
	l1 = b
	l2 = a + c
	(a1, a2) = (a, c)
else:
	l1 = c
	l2 = b + a
	(a1, a2) = (a, b)
if l2 > l1:
	print(0)
else:
	while l1 > l2:
		l3 += 1
		if a1 < l1:
			a1 += 1
		else:
			a2 += 1
		l2 = a1 + a2
	print(l3)


def cal(a, b, c):
	m = 0
	if a > b and a > c:
		return a - (b + c) + 1
	elif b > a and b > c:
		return b - (a + c) + 1
	else:
		return c - (a + b) + 1
(a, b, c) = map(int, input().split())
if a + b > c and b + c > a and (c + a > b):
	print(0)
else:
	print(cal(a, b, c))


e = [int(s) for s in input().split(' ')]
print(max(2 * max(e) - sum(e) + 1, 0))


h = list(map(int, input().split()))
a = min(h)
h.remove(a)
b = min(h)
c = max(h)
if a + b > c:
	print(0)
else:
	print(c - (a + b) + 1)


(a, b, c) = map(int, input().split())
w = []
if c - (a + b) >= 0:
	w.append(c - (a + b))
if a - (c + b) >= 0:
	w.append(a - (c + b))
if b - (a + c) >= 0:
	w.append(b - (a + c))
if len(w) == 0:
	print(0)
else:
	print(max(w) + 1)


(a, b, c) = map(int, input().split())
result = 0
if a >= b + c or b >= c + a or c >= a + b:
	result = max(a, b, c) * 2 - a - b - c + 1
print(result)


gi = lambda : list(map(int, input().split()))
l = gi()
l.sort()
(a, b, c) = l
if a + b > c:
	print(0)
else:
	print(c - a - b + 1)


(a, b, c) = [int(x) for x in input().split()]
count = 0
if a + b <= c:
	count = c - a - b + 1
elif b + c <= a:
	count = a - b - c + 1
elif c + a <= b:
	count = b - a - c + 1
print(count)


numList = [int(x) for x in input().split()]
numList.sort()
number = numList[2] - (numList[0] + numList[1]) + 1
if number < 0:
	number = 0
print(number)


a = list(map(int, input().split()))
a.sort()
d = 0
while a[0] + a[1] <= a[2]:
	a[0] = a[0] + 1
	d = d + 1
print(d)


def get_input_list():
	return list(map(int, input().split()))
(a, b, c) = get_input_list()
print(max(0, 2 * max(a, b, c) - a - b - c + 1))


s = input()
x = s.split()
(a, b, c) = (int(x[0]), int(x[1]), int(x[2]))
t = 0
if a >= b + c:
	t = a - (b + c) + 1
if b >= a + c:
	t = b - (a + c) + 1
if c >= a + b:
	t = c - (a + b) + 1
print(t)


lados = input().split(' ')
vec = [int(lados[0]), int(lados[1]), int(lados[2])]
nec = sorted(vec)
count = 0
while True:
	if nec[0] + nec[1] > nec[2]:
		print(count)
		break
	else:
		nec[0] += 1
		count += 1


(a, b, c) = map(int, input().split())
s1 = a + b - c
s2 = c + a - b
s3 = b + c - a
ans = min(s1, s2, s3)
if ans > 0:
	print(0)
else:
	print(abs(ans) + 1)


a = list(map(int, input().split()))
t = 0
if a[0] + a[1] > a[2] and a[0] + a[2] > a[1] and (a[2] + a[1] > a[0]):
	print(0)
else:
	while a[0] + a[1] <= a[2] or a[0] + a[2] <= a[1] or a[2] + a[1] <= a[0]:
		a[a.index(min(a))] += 1
		t += 1
		if a[0] + a[1] > a[2] and a[0] + a[2] > a[1] and (a[2] + a[1] > a[0]):
			break
	print(t)


import math
from sys import stdin
string = stdin.readline().strip().split()
a = int(string[0])
b = int(string[1])
c = int(string[2])
lst = [a, b, c]
lst.sort()
result = 0
if lst[0] + lst[1] <= lst[2]:
	result = lst[2] - lst[1] - lst[0] + 1
print(result)


n = [int(a) for a in input().split()]
n = sorted(n)
print(max(0, n[2] - n[1] - n[0] + 1))


arr = list(map(int, input().split(' ')))
c = max(arr)
arr.remove(max(arr))
a = arr[0]
b = arr[1]
if a + b > c:
	print(0)
else:
	print(c - (a + b) + 1)


def recursion(p, x):
	if x[0] + x[1] <= x[2]:
		x[0] += 1
		p += 1
		recursion(p, x)
	else:
		print(p)
(x, p) = (sorted([int(_) for _ in input().split()]), 0)
recursion(p, x)


line = input()
nums = [int(x) for x in line.split(' ')]
nums.sort()
(a, b, c) = nums
minutes_needed = 0
while a + b <= c:
	b += 1
	minutes_needed += 1
print(minutes_needed)


a = [int(i) for i in input().split()]
z = 0
a = sorted(a)
while a[2] >= a[1] + a[0]:
	a[0] = a[0] + 1
	z += 1
	a = sorted(a)
print(z)


a = list(map(int, input().split()))
a = sorted(a)
if a[0] + a[1] > a[2]:
	print(0)
else:
	x = a[2]
	diff = x + 1 - (a[0] + a[1])
	print(diff)


tmp = list(map(int, input().split()))
tmp.sort()
A = tmp[2]
B = tmp[0]
C = tmp[1]
cnt = 0
while B + C <= A:
	cnt += 1
	B += 1
print(cnt)


import math

def get_int_vector():
	return [int(x) for x in input().split()]
a = get_int_vector()
a.sort()
if a[2] < a[0] + a[1]:
	print(0)
	exit(0)
dist = a[2] - (a[0] + a[1]) + 1
print(dist)


def solve():
	line = input()
	a = int(line.split(' ')[0])
	b = int(line.split(' ')[1])
	c = int(line.split(' ')[2])
	rslt = 0
	if a >= b + c:
		rslt = a - b - c + 1
	if b >= a + c:
		rslt = b - a - c + 1
	if c >= a + b:
		rslt = c - a - b + 1
	print(rslt)
solve()


(a, b, c) = map(int, input().split(' '))
x = 0
y = 0
z = 0
if a + b <= c:
	x = x + abs(c - (a + b)) + 1
if a + c <= b:
	y = y + abs(b - (c + a)) + 1
if c + b <= a:
	z = z + abs(a - (b + c)) + 1
print(x + y + z)


import sys
(a, b, c) = map(int, input().split())
time = 0
found = False

def triangle_check(a, b, c):
	if a + b > c and b + c > a and (a + c > b):
		print(time)
		sys.exit(0)
while True:
	triangle_check(a + time, b, c)
	triangle_check(a, b + time, c)
	triangle_check(a, b, c + time)
	time += 1


(a, b, c) = map(int, input().split())
x = max(a, b, c)
z = min(a, b, c)
y = a + b + c - x - z
if z + y > x:
	print('0')
else:
	print(x - y - z + 1)


x = input()
y = x.split()
t = []
for num in y:
	t.append(int(num))
t.sort()
if int(t[2]) < int(t[1]) + int(t[0]):
	print('0')
else:
	a = int(t[2]) - int(t[1]) - int(t[0]) + 1
	print(a)


(a, b, c) = map(int, input().split())
max_length = max(a, b, c)
perimeter = a + b + c
if perimeter - max_length > max_length:
	print(0)
else:
	print(max_length * 2 - perimeter + 1)


tri = [int(i) for i in input().split(' ')]
dists = [tri[0] + tri[1] - tri[2], tri[0] + tri[2] - tri[1], tri[1] + tri[2] - tri[0]]
md = min(dists)
print(max(0, 1 - md))


(a, b, c) = map(int, input().split())
m = max(a, b, c)
x = y = -1
if m == a:
	x = b
	y = c
if m == b:
	x = a
	y = c
if m == c:
	x = a
	y = b
print(max(m - (x + y) + 1, 0))


l = list(map(int, input().split()))
l.sort()
zbroj = l[0] + l[1]
treci = l[2]
vrijeme = 0
while True:
	if zbroj > treci:
		break
	vrijeme += 1
	zbroj += 1
print(vrijeme)


l = list(map(int, input().split()))
l.sort()
x = l[2] - l[1] - l[0]
if l[1] + l[0] > l[2] and l[0] + l[2] > l[1] and (l[2] + l[1] > l[0]):
	print(0)
else:
	print(x + 1)


def readint():
	return int(input())

def readline():
	return [int(c) for c in input().split()]

def main():
	(a, b, c) = readline()
	s = a + b + c
	m = max(a, b, c)
	s -= m
	print(max(0, m - s + 1))
main()


(a, b, c) = map(int, input().split())
count = 0
while a + b <= c:
	if a == min(a, b):
		a += 1
	else:
		b += 1
	count += 1
while b + c <= a:
	if b == min(c, b):
		b += 1
	else:
		c += 1
	count += 1
while a + c <= b:
	if a == min(a, c):
		a += 1
	else:
		c += 1
	count += 1
print(count)


a = input().split()
s = []
for i in a:
	s.append(int(i))
s.sort()
d = s.pop(s.index(max(s)))
if d < sum(s):
	print(0)
else:
	print(d - sum(s) + 1)


def main():
	vals = [int(v) for v in input().split()]
	vals.sort()
	print(max(0, vals[2] - (vals[0] + vals[1]) + 1))
main()


s1 = input().split()
a = int(s1[0])
b = int(s1[1])
c = int(s1[2])
ans = 0
if a == b == c:
	print(0)
elif a < b + c and b < a + c and (c < a + b):
	print(0)
else:
	p = max(a, b, c)
	y = min(a, b, c)
	t = a + b + c - p - y
	ans = p - (t + y) + 1
	print(ans)


import math
(a, b, c) = sorted(list(map(int, input().split())))
t = c - b - a + 1
if t > 0:
	print(t)
else:
	print(0)


tri = [int(x) for x in input().split()]
tri = sorted(tri)
(a, b, c) = (tri[0], tri[1], tri[2])
s = a + b
if s > c:
	print(0)
else:
	print(c + 1 - (b + a))


l = list(map(int, input().split()))
n = max(l)
l.remove(n)
m = sum(l)
if m > n:
	print(0)
else:
	print(abs(m - n) + 1)


(a, b, c) = map(int, input().split())
x = a + b - c
y = b + c - a
z = a + c - b
ans = 0
for i in [x, y, z]:
	if i < 1 and (ans == 0 or 1 - i < ans):
		ans = 1 - i
print(ans)


def go():
	(a, b, c) = [int(i) for i in input().split(' ')]
	x = 0
	while True:
		if a + b > c:
			if b + c > a:
				if a + c > b:
					return x
		if a <= b and a <= c:
			a += 1
		elif b <= a and b <= c:
			b += 1
		elif c <= a and c <= b:
			c += 1
		x += 1
print(go())


(a, b, c) = sorted(map(int, input().split()))
n = 0
if a + b <= c:
	n = c - (a + b) + 1
	a += n
	assert a + b > c
print(n)


A = list(map(int, input().split()))
A = sorted(A)
A = list(reversed(A))
ans = 0
while A[0] >= A[1] + A[2]:
	A[1] += 1
	ans += 1
print(ans)


li = list(map(int, input().split()))
li.sort()
ret = 0
while li[2] - li[1] >= li[0]:
	li[0] += 1
	ret += 1
	li.sort()
print(ret)