#131 manhattann distance
x,y,d=(int(i) for i in input().split())
if x+y>d:
    print(0)
else:
    if x>y:
        m=y
        t=x
    else:
        m=x
        t=y
if d<m:
        print(d+1)
elif d<=t:
    print(m+1)
else:
    print(x+y-d+1)