x, y, d = map(int, input().split()) ans = max(0, d+1-max(0, d-y)-max(0, d-x)) print(ans)