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