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