#include #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int x, y, z; cin >> x >> y >> z; if (abs(x - y) > z) { cout << min(x, y) + z << endl; } else { cout << (x + y + z) / 2 << endl; } return 0; }