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