import Control.Monad
import Control.Applicative

main = do
  [a, b, c, d, p] <- replicateM 5 readLn

  let x = a * p
      y = calc p c b d

  print $ min x y


calc p c b d
  | p < c = b
  | otherwise = b + (p - c) * d