#include using namespace std; int main() { int64_t x, y, z; cin >> x >> y >> z; int64_t n = z; if (x <= z) n--; if (y <= z) n--; if (!n) n = 0; cout << n << endl; }