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) ->
  [
    a * x + b * y
    a * (x - y) + c * 2 * (x - y)
    b * (y - x) + c * 2 * (y - x)
    c * 2 * (max x y)
  ]
  |> Seq.filter (fun p -> p > 0)
  |> Seq.min
|> printfn "%d"
