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