#include #include #include #include #include #include #define Max(a, b) ((a) > (b) ? (a) : (b)) #define Min(a, b) ((a) > (b) ? (b) : (a)) #define abs(x) ((x) > 0 ? (x) : -(x)) #define rep(i, n) for(int i = 0; i < (n); i++) #define MOD 1000000007 //10^9 + 7 #define endl printf("\n") typedef long long ll; #define MAX_N (1 << 17) int main(int argc, char **argv) { ll x, y, z; scanf("%lld %lld %lld", &x, &y, &z); ll ans = z; if (x <= z) ans -= 1; if (y <= z) ans -= 1; printf("%lld\n", ans); return 0; }