x,y,d = gets.split.map(&:to_i) ans = [d,x].min + [d,y].min - d + 1 if ans < 0 p 0 else p ans end