#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

int main() {
	i64 x, y, z;
	cin >> x >> y >> z;
	i64 zz = min(z, abs(x - y));
	z -= zz;
	i64 a = min(x, y);
	i64 b = max(x, y);
	cout << min(b, a + zz) + z / 2 << endl;
}