#include int main(void){ int x,y,z; scanf("%d %d %d",&x,&y,&z); for(;x!=y;){ if(x>y){ y++; z--; } else{ z--; x++; } } printf("%d\n",x+(z/2)); return 0; }