#include using namespace std; using ll = long long; using pii = pair; using vi = vector; using vl = vector; #define rep(i, n) for(ll i = 0;i < n;i++) #define all(i) i.begin(), i.end() template bool cmax(T& a, U b) { if (a bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll x, y, z; cin >> x >> y >> z; ll ans = z; if (x <= z) ans--; if (y <= z) ans--; cout << ans << endl; }