for(glob<>){ $a+=$_%3?$_%5?length:4:$_%5?4:8; } print$a;