#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
using namespace std;
ll mod = 1e9 + 7;

int main()
{
	int x, y, z;
	cin >> x >> y >> z;
	int d = abs(x - y);
	int ans;
	if (d >= z)ans = min(x + z, y + z);
	else
	{
		z -= d;
		ans = max(x, y) + z / 2;
	}
	co(ans);
	return 0;
}