import math import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LS(): return list(sys.stdin.readline().rstrip().split()) x, y, d = MI() if x > y: x, y = y, x if d <= x: print(d+1) elif d <= y: print(x+1) elif d <= x + y: print(x + y - d + 1) else: print(0)