#include <iostream>
 int main() {
 	int A, B, C, X, Y;
 	std::cin >> A >> B >> C >> X >> Y;
 	int x = X;
 	int y = Y;
 	int Z = A + B;
 	if (Z / 2 => C) {
 		
 			x /= 2;
 			y /= 2;
 			 if (x == y) {
 			 	std::cout << 4 * x * C <<std::endl;
 			 	exit (0);
 			 } else if (X > Y) {
 			 	std::cout << (4 * y * C) + A * (X - Y) <<std::endl;
				exit(0);
 			 } else {
 			 	std::cout << (4 * x * C) + B * (Y - X) <<std::endl;
 			 	exit(0);
 			 }

 	} else if (Z / 2 < C) {
 		std::cout << A * X + B * Y <<std::endl;
 		exit(0); 
 	}

 































 	return 0;
 }