def main(): x, y, d = map(int, input().split()) if d > (x+y): print(0) return if d <= min(x, y): print(d+1) return if d <= max(x, y): print(min(x, y)+1) return print(min(x, y) + 1 - (d - max(x, y))) if __name__ == "__main__": main()