import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): x, y, d = getlist() x, y = list(sorted([x, y])) if d <= x: print(d + 1) elif x <= d and d <= y: print(x + 1) elif d <= x + y: print(x + y + 1 - d) else: print(0) if __name__ == '__main__': main()