import Data.Bifunctor (first)
import Data.Bool      (bool)

main :: IO ()
main = do
    [n, e, t] <- fmap read . words <$> getLine
    xs        <- fmap read . words <$> getLine
    answer $ solve e t xs

type Answer = Int
answer :: Answer -> IO ()
answer = print

solve :: Int -> Int -> [Int] -> Answer
solve e t = go e
  where
    go s []  = s
    go s [_] = s + t
    go s xs = uncurry go . first (s +) $ inner 1 0 . head <*> id $ xs
    inner k l b (x : xs)
      | 2 * d <= s = inner (succ k) d b xs
      | otherwise  = (bool (min (pred k * t) (2 * l)) t (k == 2), x : xs)
      where
        d = x - b
        s = k * t
    inner k l _ _  = (min (pred k * t) (2 * l), [])
