x, y, d = map(int, input().split()) if d > x + y: print(0) elif d <= x and d <= y: print(d+1) else: if d > x and d > y: tmp = max(x, y) else: tmp = min(x, y) print(d-tmp+1)