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