-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = print . solve . map read . tail . words =<< getContents where solve xs = sum $ foldr f xs [2..100] f i rs = if foldr (\x b -> b && mod x i == 0) True rs then fmap (`div` i) rs else rs