#include main(){ int N[3]; scanf("%d%d%d",&N[0],&N[1],&N[2]); int count = 0; std::sort(N,N+3); while(N[0]>=1 || (N[1]>=1 && N[2]>=3)|| N[2]>=5){ int num = N[0]; N[0] -= num; N[1] -= num; N[2] -= num; count += num; // printf("%d %d %d %d\n",N[0],N[1],N[2],count); if(N[1]){ N[0] = std::max(N[2]/4,1); N[2] -= N[0]*2; }else{ N[0] = N[2]/5; N[1] = N[2]/5; N[2] -= N[0]*4; } std::sort(N,N+3); } printf("%d\n",count); }