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