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