let () =
  let a = read_int () and
      b = read_int () and
      c = read_int () and
      d = read_int () and
      p = read_int () in
  let x = a*p and
      y = if p <= c then b else b + d*(p-c) in
  Printf.printf "%d\n" (if x > y then y else x)
;;