#include using namespace std; using i64 = long long int; #define rep(i, n) for(int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() int main(){ i64 x, y, z; cin >> x >> y >> z; if(x > y) swap(x, y); if(y - x <= z) cout << y + (z - (y - x)) / 2 << endl; else cout << (x + z) / 2 << endl; }