import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm; void main(){ auto buf = readln().strip().split().map!(to!int)().array; int maxe = max(buf[0], buf[1]); int mine = min(buf[0], buf[1]); int d = buf[2]; if(d > maxe) { d = maxe + mine - d; } else if(d > mine) { d = mine; } if(d < 0) { writeln(0); } else { writeln(d+1); } }