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