#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #include using namespace std; //std::ios::sync_with_stdio(false); //std::cin.tie(0); const long long MOD = 1e9 + 7; typedef long long ll; typedef long double ld; typedef pair pll; typedef pair pdl; typedef pair pdd; typedef vector VLL; typedef vector VVLL; //typedef boost::multiprecision::cpp_int bigint; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); ll A, B, C; cin >> A >> B >> C; ll ans = 0; for (ll c = 0; c <= C; c++) { ll a = A + c; ll b = B + (C - c); ans = max(ans, min(a, b)); } cout << ans << "\n"; return 0; }