#include using namespace std; int main() { int64_t x, y, z; cin >> x >> y >> z; if (z < x) cout << z << endl; else if (x <= z && z < y) cout << z - 1 << endl; else cout << z - 2 << endl; return 0; }