<>; for(<>){ ($a,$b,$c)=glob; $d=$b>>1; $b-=$d*2; $e=$a<$c?$a:$c; $a-=$e; $f=$a<$b?$a:$b; print$d*2+$e*2+$f,$/; }