using System;
using System.Collections.Generic;
using System.Linq;

class Program{

  static int a, b, c, x, y, i, cost, cost2, answer;

  static int Main() {
    string[] nyu = new string[5];

    nyu = Console.ReadLine().Split(' ');
    a = int.Parse(nyu[0]);
    b = int.Parse(nyu[1]);
    c = int.Parse(nyu[2]);
    x = int.Parse(nyu[3]);
    y = int.Parse(nyu[4]);

    cost = a*x + b*y ;
    answer = cost;

    for (i = 1; i<=Math.Max(int.Parse(nyu[3]), int.Parse(nyu[4]))*2-1; i++){
      if(x > 0) x -= 1;
      if(y > 0) y -= 1;

      cost =  a*x + b*y + c*2*i;

      if(cost < answer){
       answer = cost;
      }else{
        break;
      }
    }

    Console.Write("{0}, x={1}, y={2}, i={3}", answer, x, y, i);
    return 0;
  }

}
