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