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