import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = breads >>= main'
    where
        main' (_ : a : b : _) = breads >>= print . solve a b 

solve :: Int -> Int -> [Int] -> Int 
solve a b = check 0
    where
        check acc (x : y : zs) = check (acc + (min b $ a * (y - x))) (y : zs)
        check acc _ = acc

breads :: IO [Int]
breads = unfoldr uff <$> B.getLine
    where
        uff b = check <$> B.readInt b
        check (a, b)
            | B.null b = (a, b)
            | otherwise = (a, B.tail b)
