module Main where import Data.List eval :: Int -> Int -> [Int] -> [Int] eval 0 _ = id eval t d = eval (t - 1) d . f . (>>= \x -> [x+d, x, x-d]) where f = g . sort g [] = [] g (x:xs) = x : g (filt (/= x) xs) filt _ [] = [] filt p (y:ys) = if p y then y:ys else filt p ys main :: IO () main = do [_, d, t] <- fmap (map read . words) getLine xs <- fmap (map read . words) getLine print $ length $ eval t d xs