#include using namespace std; int x, y, z; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> x >> y >> z; if(x > y) swap(x, y); if(x+z < y){ cout << x+z << endl; } else{ cout << y+(z-(y-x))/2 << endl; } return 0; }