import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.List

main :: IO ()
main = do
  [n, x] <- map read . words <$> getLine
  a <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
  let
    l = sort a
    m = head l
    ml = takeWhile (< m+x) l
  print $ sum ml + (n - length ml) * (m + x)
