#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int x,y,z; cin >> x >> y >> z; int a = min(x, y); int b = max(x, y) - a; if(b > z) { cout << a + z << endl; } else { cout << a + b + (z - b) / 2 << endl; } return 0; }