stdin.ReadLine()
|> fun x -> x.Split(' ')
|> Array.map int
|> fun x -> (x.[0], x.[1], x.[2], x.[3], x.[4])
|> fun (a, b, c, x, y) -> (
  if a + b <= c * 2
  then
    (x * a + y * b)
  else
    if (if x > y then a else b) < c * 2
    then
      (x * a + y * b) - (((a + b) - (c * 2)) * ((min x y) / 2) * 2)
    else
      (max x y) * c * 2
)
|> printfn "%d"
