#include using namespace std; #define all(x) x.begin(), x.end() #define rep(i, n) for (int i = 0; i < n; ++i) #define reps(i, m, n) for (int i = m; i <= n; ++i) using i64 = long long; using pii = pair; templateinline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;} templateinline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;} constexpr int INF = 0x3f3f3f3f; constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr int MOD = int(1e9) + 7; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); i64 x, y, z; cin >> x >> y >> z; i64 ans = z; if (x <= z) --ans; if (y <= z) --ans; cout << ans << "\n"; return 0; }