import std.algorithm, std.array, std.container, std.range; import std.string, std.conv; import std.math, std.bigint, std.bitmanip, std.random; import std.stdio, std.typecons; const auto mod = 10^^9; void main() { auto rd = readln.split.map!(to!int); auto x = rd[0], y = rd[1], d = rd[2]; if (d <= x + y) { auto r = d + 1; r -= max(d - y, 0); r -= max(d - x, 0); writeln(r); } else { writeln(0); } }