#include using namespace std; using ll = long long; using P = pair; using PL = pair; // Welcome to my source code! int main() { ll x, y, z; cin >> x >> y >> z; ll ans = z; if (x <= z) ans--; if (y <= z) ans--; cout << ans << endl; }