fizzbuzz :: (Integral a, Show a) => a -> String fizzbuzz n | mod n 15 == 0 = "FizzBuzz" | mod n 3 == 0 = "Fizz" | mod n 5 == 0 = "Buzz" | otherwise = show n readInt :: String -> Int readInt = read main :: IO () main = getLine >>= print . sum . fmap (length . fizzbuzz . readInt) . words