#include using namespace std; int main() { int x, y, z; cin >> x >> y >> z; int rest = 0; if (x <= z) ++rest; if (y <= z) ++rest; cout << z - rest << '\n'; }