#include using namespace std; bool can_create(int k,int r,int g,int b){ r -= k; g -= k; b -= k; int plus = 0; int minus = 0; if(r > 0){ plus += r; } else { minus -= r; } if(g > 0){ plus += g; } else { minus -= g; } if(b > 0){ plus += b; } else { minus -= b; } if(plus >= minus * 2){ return true; } return false; } int main(){ int i,r,g,b; scanf("%d %d %d",&r,&g,&b); int left = 0,right = r+g+b; int mid; while(right - left > 2){ mid = (right + left)/2; if(can_create(mid,r,g,b)){ left = mid; } else { right = mid; } } printf("%d",left); }