($a,$b,$c)=sort{$a-$b}glob<>; $x+=$a; $b-=$a; $c-=$a; $a-=$a; $t=$b<$c/3?$b:$c/3|0; $x+=$t; $b-=$t; $c-=$t*3; $t=$c<$b/3?$c:$b/3|0; $x+=$t; $c-=$t; $b-=$t*3; $x+=$c/5|0; $c%=5; print$x