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