$a+=$_*(`factor $_`=~/ $_/)for 1..<>;print$a