module Main where type Input = (Int, Int, [Int]) type Output = Int parse :: String -> Input parse s = let [n, x] = map read . words . head $ lines s ss = map read . words . (!! 1) $ lines s in (n, x, ss) solve :: Input -> Output solve (n, x, ss) = sum ss - pred n * x render :: Output -> String render = show main :: IO () main = interact ( render . solve . parse )