#include using namespace std; int main() { int64_t x, y, z; cin >> x >> y >> z; int64_t ans = 0; for (int i = 0; i <= z; i++) { int64_t a = x + i; int64_t b = y + (z - i); ans = max(ans, min(a, b)); } cout << ans << endl; return 0; }