#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int r, b, w; cin >> r >> b >> w; int ans; if(abs(r - b) < w) ans = (r + b + w) / 2; else ans = min(r, b) + w; cout << ans << endl; return 0; }