jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::io;
use std::cmp;
use io_ext::Reader;

fn main() {
    let stdin = io::stdin();
    let mut r = Reader::new(io::BufReader::new(stdin.lock()));
    r.read_line();
    let ds: Vec<u64> = r.read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();

    let mut sum = 0;
    
    for &d in &ds {
        sum += d;
    }

    let mut ans = 0;
    for &d in &ds {
        let rest = sum - d;
        ans += d * rest;
    }
    ans /= 2;

    println!("{}", ans);
}

/// Extension of io module.
pub mod io_ext {
    use std::io::BufRead;

    pub struct Reader<R> {
        buf: String,
        inner: R,
    }

    impl<R> Reader<R> {
        #[inline]
        pub fn new(inner: R) -> Self {
            Reader { buf: String::new(), inner: inner }
        }

        #[inline]
        pub fn into_inner(self) -> R {
            self.inner
        }
    }

    impl<R: BufRead> Reader<R> {
        #[allow(deprecated)]
        #[inline]
        pub fn read_line(&mut self) -> &str {
            self.buf.clear();
            self.inner.read_line(&mut self.buf).unwrap_or_else(|e| panic!("{}", e));
            self.buf.trim_right()
        }
    }
}

/// Module supporting to parse strings.
pub mod parse {
    use std::str::FromStr;
    use std::borrow::Borrow;

    pub trait ParseNext: Iterator {
        fn parse_next<F: FromStr>(&mut self) -> F;
    }

    impl<'a, S: Borrow<str>, I: Iterator<Item=S>> ParseNext for I {
        fn parse_next<F: FromStr>(&mut self) -> F {
            if let Some(s) = self.next() {
                match s.borrow().parse() {
                    Ok(x) => x,
                    Err(_) => panic!("provided string cannot be parsed")
                }
            } else {
                panic!("iterator has no next element")
            }
        }
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
        d: [usize; n]
    };
    let mut ans = 0;
    for i in 0..n-1 {
        for j in i+1..n {
            ans += d[i] * d[j];
        }
    }
    println!("{}", ans);
}
//  [swift]
let N = Int(readLine()!)!
let d = readLine()!.characters.split(" ").map{Int(String($0))!}
var sum = 0
for i in 0..<N {
  for j in i+1..<N {
    sum += d[i]*d[j]
  }
}
print(sum)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let n=Int(readLine()!)!
let dd=readInts()
var count=0
for i in 0...n-2{
  for j in i+1...n-1{
    count+=dd[i]*dd[j]
  }
}
print(count)
//  [swift]
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let nk=readInts()
let n=nk[0]
let d=readInts()
var ans=0

for i in 0..<n-1{
  for j in i+1..<n{ans+=d[i]*d[j]}
}

print(ans)
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [n]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const d: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    let result = 0;
    for (let i = 0; i < n; i++) {
      for (let j = i + 1; j < n; j++) {
        result += d[i] * d[j];
      }
    }
    return `${result}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
import * as fs from 'fs';

//in
// 3
// 3 1 2
//out
// 11
const main = (inp: string) => {
    const n: number = parseInt(inp.split('\n')[0]);
    const d: number[] = inp.split('\n')[1].split(' ').map(a => parseInt(a));

    let cur: number = 1;
    let ans: number = 0;
    for (let i: number = 0; i < n; i++) {
        for (let j: number = cur; j < n; j++) {
            ans += d[i] * d[j];
        }
        cur++;
    }
    console.log(ans);
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
import * as fs from "fs";

const input = fs.readFileSync("/dev/stdin", "utf8").split(/\n/);
const N: number = +input[0];
const numbers = input[1].split(" ");
let inputNum: number[] = [];
for (let i = 0; i < numbers.length; i++) {
  inputNum[i] = +numbers[i];
}
let sum = 0;
let sum2 = 0;
for (let i = 0; i < N; i++) {
  sum += inputNum[i];
  sum2 += inputNum[i] * inputNum[i];
}
const ans = (sum * sum - sum2) / 2;
console.log(ans);
//  [typescript]

function main(input){
    const args = input.split("\n");
    const balls = args[1].split(" ");
    console.log(balls.reduce((acc, cur, idx, arr) => {
        let tempValue = 0
       let count = -1
       for(let val of arr){
           count = count + 1
           if(count === idx) continue
           tempValue = val * cur + tempValue
       }
    return acc + tempValue
    }, 0) / 2)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const combination = (nums, k) => {
    let ans = [];
    if (nums.length < k) {
        return []
    }
    if (k === 1) {
        for (let i = 0; i < nums.length; i++) {
            ans[i] = [nums[i]];
        }
    } else {
        for (let i = 0; i < nums.length - k + 1; i++) {
            let row = combination(nums.slice(i + 1), k - 1);
            for (let j = 0; j < row.length; j++) {
                ans.push([nums[i]].concat(row[j]));
            }
        }
    }
    return ans;
}
const main = (input) => {
 	const data = input.split('\n')
    const n = Number(data[0])
    const ds = data[1].split(' ').map(n => Number(n))
	const arr = combination(ds, 2)
    
    let result = 0;
  	arr.forEach(nums => {
    	result += nums.reduce((a, b) => a*b)
    })
  console.log(result)
 
 
 
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const n: number = +input[0];
const d: number[] = input[1].split(' ').map((x: string): number => +x);

let ans: number = 0;

for(let i = 0; i < n; i++){
    for(let j = i+1; j < n; j++){
        ans += d[i] * d[j];
    }
}
console.log(ans);
//  [python]
import sys

A,B,C,X,Y=list(map(int,input().split()))


cost=0
if 2*C<A+B:
	mini=min([X,Y])
	cost+=mini*C*2
	X-=mini
	Y-=mini
	if not X==0:
		if 2*C<A:
			cost+=2*C*X
			X=0
	elif not Y==0:
		if 2*C<B:
			cost+=2*C*Y
			Y=0



cost+=X*A+Y*B

print(cost)
//  [python]
a,b,c,x,y=map(int,input().split())
price=0
z=min(x,y)
w=max(x,y)
if a+b>c*2:
    d=w*2*c
    e=z*c*2+(x-z)*a+(y-z)*b
    print(min(e,d))

else:
    print(a*x+b*y)
//  [python]
a,b,c,x,y=[int(i) for i in input().split()]

if x>=y:
    print( min(y*2*c+a*(x-y), x*a+y*b, 2*c*x) )

else:
    print( min(x*2*c+b*(y-x), x*a+y*b, 2*c*y) )
//  [python]
import numpy as np
A, B, C, X, Y = list(map(int, input().split()))

min_money = A*X + B*Y

status = np.array([X,Y,0])
delta_status = np.array([-1,-1,2])
block_status = np.array([0,0,0])
values = np.array([A,B,C])

for _ in range(max(X,Y)):
    status += delta_status
    status = np.max(np.array([status,block_status]), axis=0)
    
    tmp_money = sum(status * values)
    min_money = min(tmp_money,min_money)
print(min_money)
//  [python]
import random

#--------ピ　ザ　群　最　適　化------------------------------

#評価関数: 　双対問題
def criterion(x, y):
    z=xo*x+yo*y

    if x>a or y>b or x+y>2*c or x<0 or y<0:
        z=-z
    
    return z

#粒子の位置の更新を行う関数
def update_position(x, y, vx, vy):
 
    new_x = x + vx
    new_y = y + vy

    return new_x, new_y

#粒子の速度の更新を行う関数
def update_velocity(x, y, vx, vy, p, g, w=1, ro_max=0.5,v_max=10):
    #パラメーターroはランダムに与える
    ro1 =random.uniform(0, ro_max)
    ro2 =random.uniform(0, ro_max)
    #粒子速度の更新を行う
    new_vx = int((w * vx + ro1 * (p["x"] - x) + ro2 * (g["x"] - x)))
    new_vy = int((w * vy + ro1 * (p["y"] - y) + ro2 * (g["y"] - y)))
    if abs(new_vx)>v_max:
        new_vx=int(v_max*new_vx/abs(new_vx))
    if abs(new_vy)>v_max:
        new_vy=int(v_max*new_vy/abs(new_vy))

    #print(new_vx, new_vy)
    return new_vx, new_vy
    
def main():
    N = 2000  #粒子の数
    x_min, x_max = 0, a
    y_min, y_max = 0, b
    #粒子位置, 速度, パーソナルベスト, グローバルベストの初期化を行う
    ps = [{"x": random.randint(x_min, x_max), 
        "y": random.randint(y_min, y_max)} for i in range(N)]
    vs = [{"x": 0, "y": 0} for i in range(N)]

    personal_best_positions = list(ps)
    personal_best_scores = [criterion(p["x"], p["y"]) for p in ps]

    best_particle = personal_best_scores.index(max(personal_best_scores))
    global_best_position = personal_best_positions[best_particle]

    T = 100  #制限時間(ループの回数)
    for t in range(T):
        for n in range(N):
            x, y = ps[n]["x"], ps[n]["y"]
            vx, vy = vs[n]["x"], vs[n]["y"]
            p = personal_best_positions[n]
            #粒子の位置の更新を行う
            new_x, new_y = update_position(x, y, vx, vy)
            ps[n] = {"x": new_x, "y": new_y}
            #粒子の速度の更新を行う
            new_vx, new_vy = update_velocity(
                new_x, new_y, vx, vy, p, global_best_position)
            vs[n] = {"x": new_vx, "y": new_vy}
            #評価値を求め, パーソナルベストの更新を行う
            score = criterion(new_x, new_y)
            if score > personal_best_scores[n]:
                personal_best_scores[n] = score
                personal_best_positions[n] = {"x": new_x, "y": new_y}
        #グローバルベストの更新を行う
        best_particle = personal_best_scores.index(max(personal_best_scores))
        global_best_position = personal_best_positions[best_particle]
#        print(max(personal_best_scores), global_best_position["x"], global_best_position["y"])

    #最適解
    return max(personal_best_scores), global_best_position["x"], global_best_position["y"]


#--------------------------------------------------------------

a, b, c, xo, yo = [int(i) for i in input().split()]
#a, b, c, xo, yo = 1500, 2000, 500, 90000, 100000
best=-100000000
xx=0
yy=0
for i in range(3):
    kouho_best, kouho_x, kouho_y=main()
    if best<kouho_best:
        best=kouho_best
        xx=kouho_x
        yy=kouho_y

print(best)
//  [python]
A, B, C, X, Y = map(int, input().split())

answer = 10**18
n = 2*10**6+1
for c in range(n):
  a = X-c
  b = Y-c
  cost = C*c*2
  cost += max(a, 0)*A
  cost += max(b, 0)*B
  if answer > cost:
    answer = cost
print(answer)
//  [java]
import java.io.IOException;
import java.util.NoSuchElementException;

import java.io.InputStream;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner fs = new FastScanner();

        final int A = fs.nextInt();
        final int B = fs.nextInt();
        final int C = fs.nextInt();
        final int X = fs.nextInt();
        final int Y = fs.nextInt();

        int ans;

        if (A + B < 2 * C) ans = A * X + B * Y;
        else {
            int tmp1 = X <= Y ?
                2 * C * X + B * (Y - X)
                : A * (X - Y) + 2 * C * Y;

            int tmp2 = X <= Y ?
                2 * C * Y
                : 2 * C * X;

            ans = Math.min(tmp1, tmp2);
        }

        System.out.println(ans);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
        if (hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if(b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int ab = a * x + b * y;

		int min = 0;
		int max = 0;
		int than = 0;

		if (x > y) {
			min = 2 * y;
			max = 2 * x;
			than = a * (x - y);
		} else {
			min = 2 * x;
			max = 2 * y;
			than = b * (y - x);
		}

		int z = c * min + than;
		int zz = c * max;

		if (ab > z) {
			System.out.println(Math.min(z, zz));
		} else {
			System.out.println(Math.min(ab, zz));
		}
	}
}
//  [java]
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int a = scanner.nextInt(), b = scanner.nextInt(), c = scanner.nextInt();
			int x = scanner.nextInt(), y = scanner.nextInt();
			int max = Math.max(x, y);
			max = (1 == (max & 1)) ? max + 1 : max;
			System.out.println(IntStream.rangeClosed(0, max)
					.map(i -> i * 2 * c + Math.max(x - i, 0) * a + Math.max(y - i, 0) * b).min().getAsInt());
		}
	}
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main() {
  int64_t A, B, C;
  int64_t X, Y;
  cin >> A >> B >> C >> X >> Y;

  int64_t minCost = 1LL << 60;
  for (int ci = 0; ci <= 2 * max(X, Y) + 10; ci += 2) {
    int ai = max(0L, X - ci / 2);
    int bi = max(0L, Y - ci / 2);
    int64_t cost = A * ai + B * bi + C * ci;
    minCost = min(minCost, cost);
  }
  printf("%ld\n", minCost);

  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;

int main() {
  int a,b,c,x,y,ans,lim;
  cin >> a >> b >> c >> x >> y;
  ans = a*x+b*y;
  lim = max(x,y);
  repd(i,1,lim+1){
    int amai = (x-i>=0)?x-i:0;
    int bmai = (y-i>=0)?y-i:0;
    int cans = a*amai+b*bmai+c*2*i;
    ans = min(ans,a*amai+b*bmai+c*2*i);
  }
  cout << ans << endl;
}
//  [cpp]
#include "bits/stdc++.h"
using namespace std;


/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))


/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
const int inf = 100100100100100100;
const int mod = 1e9;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};


/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }




/* main */
int n,m;
char arr[100][100];
int dp[100][100];

int dfs(int x, int y){
    if(arr[y][x] == '#' or y < 0 or n <= y or x < 0 or m <= x) return 1;
    if(dp[y][x] != 0) return dp[y][x];
    if(dfs(x + 1, y) == -1) return dp[y][x] = 1;
    if(dfs(x, y + 1) == -1) return dp[y][x] = 1;
    if(dfs(x + 1, y + 1) == -1) return dp[y][x] = 1;
    return dp[y][x] = -1;
}

signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, ab, ax, by;
    cin >> a >> b >> ab >> ax >> by;

    int ans = 0;
    ans += min(a + b, ab * 2) * min(ax, by);
    
    int tmp = min(ax, by);
    ax -= tmp;
    by -= tmp;

    if(ax > 0){
        ans += min(a, ab * 2) * ax;
    }else{
        ans += min(b, ab * 2) * by;
    }

    print(ans);




    
    



    
    



 
    
    


    

    
   
    













}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 200000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    ll A,B,C; cin >> A >> B >> C;
    ll X,Y; cin >> X >> Y;
    ll out = __LONG_LONG_MAX__;
    ll cc = max(X,Y)*2;
    for(ll i=0;i<=cc;i++){
        ll cnt=0;
        ll ca = A*max(X-i/2LL,0LL);
        ll cb = B*max(Y-i/2LL,0LL);
        cnt = ca+cb+i*C;
        cerr << ca << " " << cb << " " << i*C << " " << cnt << endl;
        if(cnt<out) out = cnt;
    }
    cout << out << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 typedef long long ll;



int main() {
ll A, B, C, X, Y;
cin >>A >> B >> C >> X >> Y;
ll ans = 1000000009;
for(int i = 0; i <= 500000000; i = i+2){
    ll a;
if(i/2 > X) a = 0;
else a = X - i/2; 
ll b;
if(i/2 > Y) b = 0;
else b = Y - i/2; 

ll sumkari = A*a + B*b + C*i;
ans = min(ans, sumkari);

}

cout << ans << endl;

}
//  [c]
#include <stdio.h>
#define max(a, b) ((a)<(b) ? (b) : (a))
#define min(a, b) ((a)<(b) ? (a) : (b))

int main(){
  long long int a, b, c, x, y;
  scanf("%lld%lld%lld%lld%lld", &a, &b, &c, &x, &y);

  long long int ans = 1000000000;
  for(int ci=0; ci<=max(x, y)*2; ci+=2){
    ans = min(ans, (ci*c + max(0, x-ci/2)*a + max(0, y-ci/2)*b));
  }

  printf("%lld\n", ans);
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int A, B, C, X, Y;
	scanf("%d %d %d %d %d", &A, &B, &C, &X, &Y);
	
	int cost = A * X + B * Y, min = (X < Y)? X: Y;
	if (A + B > C * 2) cost -= ((A + B) - C * 2) * min;
	if (A > C * 2 && X > min) cost -= (A - C * 2) * (X - min);
	if (B > C * 2 && Y > min) cost -= (B - C * 2) * (Y - min);
	
	printf("%d\n", cost);
	fflush(stdout);
	return 0;
}
//  [c]
#include <stdio.h>

long min(long a,long b){
    if(a<b)return a;
    else return b;
}

int main(){
    long A,B,C,X,Y;
    long ans=0;
    scanf("%ld %ld %ld %ld %ld",&A,&B,&C,&X,&Y);
    if(min(X,Y) == X){
        ans = 2*C*X+(Y-X)*B;
        ans = min(ans,2*C*Y);
    }else{
        ans = 2*C*Y+(X-Y)*A;
        ans = min(ans,2*C*X);
    }
    printf("%ld\n",min(ans,A*X+B*Y));
    return 0;
}
//  [c]
#include<stdio.h>

int main(){

int A,B,AB,X,Y;
int calc_1,calc_2,ans;
scanf("%d%d%d%d%d",&A,&B,&AB,&X,&Y);

ans = A*X + B*Y;

if (A+B > 2*AB)
{
  if (X<Y)
  {
    calc_1 = 2*AB*X+B*(Y-X);
    calc_2 = 2*AB*Y;
    if(calc_1 < calc_2){ans = calc_1;}
    else{ans = calc_2;}
  }else
  {
    calc_1 = 2*AB*Y+A*(X-Y);
    calc_2 = 2*AB*X;
    if(calc_1 < calc_2){ans = calc_1;}
    else{ans = calc_2;}
  }
}

printf("%d",ans);


return 0;

}
//  [c]
#include<stdio.h>
int main(){
	long long A,B,C,X,Y;
	scanf("%ld%ld%ld%ld%ld",&A,&B,&C,&X,&Y);
	long long cc=0;
	if(X>Y)cc=X;
    else cc=Y;
    long long money=cc*C*2;
	for(;cc>=0;cc--){
		long long sub=0;
		if(X>cc)sub+=(X-cc)*A;
		if(Y>cc)sub+=(Y-cc)*B;
		if(money<sub+cc*C*2)break;
		money=sub+cc*C*2;
	}
	printf("%ld\n",money);
}
//  [c]
#include <stdio.h>

int main() {
	int a, b, c, x, y,ans=1000000000;
	scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
	for (int i = 0; i <= x || i <= y; i++) {
		int nab = 2 * i, na = x - i, nb = y - i;
		if (na < 0)na = 0;
		if (nb < 0)nb = 0;
		int t = a * na + nb * b + nab * c;
		if (t < ans)ans = t;
	}
	
	printf("%d", ans);
	return 0;
}
//  [javascript]
'use strict';
console.log(function(args){
  const tmp = args.trim().split(' ').map(a=>a|0);
  const A = tmp[0], B = tmp[1], C = tmp[2];
  let X = tmp[3], Y = tmp[4];
  let total = 0;
  if ( A+B > 2*C ) {
    let Z = Math.min(X,Y);
    total += Z*2*C;
    X = X - Z; Y = Y - Z;
  }
  if ( ( X > 0 && A > 2*C ) || ( Y > 0 && B > 2*C ) ) {
    total += X*2*C;
    total += Y*2*C;
  } else {
    total += X*A;
    total += Y*B;
  }
  return total.toString();
}(require('fs').readFileSync('/dev/stdin', 'utf8')));
//  [javascript]

function Main(input){
	input=input.trim().split(" ");
	A = parseInt(input[0],10);
	B = parseInt(input[1],10);
	C = parseInt(input[2],10);
	var X = parseInt(input[3],10);
	var Y= parseInt(input[4],10);
	var nA, nB, nAB, ans;
	nA = nB = nAB =0;
	function price (nA, nB, nAB){
		return nA * A + nB * B + nAB * C;
	}

	
	if (A >= (2 * C)){
		if (B >= (2 * C)){
			if (X > Y){
				nAB = (Y * 2) + ((X - Y ) * 2);
			} else {
				nAB = (X * 2) + ((Y - X ) * 2);
			}
		} else {
			nAB = X * 2;
			nB = Math.max(Y - X, 0);
		}
	} else {
		if (B >= (2 * C)){
			nAB = Y * 2;
			nA = Math.max(X - Y, 0);
		} else {
			if (A + B > (2 * C)){
				if (X > Y){
					nAB = Y * 2;
					nA = X - Y;
				} else  {
					nAB = X * 2;
					nB = Y - X;
				}
			} else {
				nA = X;
				nB = Y;
			}
		}
	}
	console.log (price(nA, nB, nAB));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
    var a = input[0].split(" ")[0]-0;
    var b = input[0].split(" ")[1]-0;
    var c = input[0].split(" ")[2]-0;
    var x = input[0].split(" ")[3]-0;
    var y = input[0].split(" ")[4]-0;
    var ans = a*x+b*y;
    ans = Math.min(ans, Math.min(x,y)*c*2 + (x>y?((x-y)*a):((y-x)*b)));
    ans = Math.min(ans, Math.max(x,y)*c*2);
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


//1 2 3 4 5 6
//  [javascript]
function Main(s) {
  s = s.split(" ").map(a => +a);
  var ans = s[0] * s[3];
  ans += s[1] * s[4];
  if(s[0] + s[1] > s[2] * 2){
    var m = Math.min(s[3], s[4]);
    ans -= (s[0] + s[1] - s[2] * 2) * m;
    s[3] -= m;
    s[4] -= m;
  }
  if(s[3]>0 && s[0]>s[2]*2)ans -= (s[0] - s[2] * 2) * s[3];
  if(s[4]>0 && s[1]>s[2]*2)ans -= (s[1] - s[2] * 2) * s[4];
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [javascript]
function Main(input){
	input=input.split(/\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	var a=input[3]-input[4];
	a=(a^(a>>31))-(a>>31);
	var b=input[3]<input[4]?0:1;//
	var c=(input[0]+input[1])*input[b+3];
	c=c<(input[2]*(input[b+3]<<1))?c:(input[2]*(input[b+3]<<1));
	b^=1;
	if(input[b]<(input[2]<<1)){c+=input[b]*a;}
	else{c+=(input[2]<<1)*a;}
	console.log(c);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let A = cin.getInt(), B = cin.getInt(), C = cin.getInt(), X = cin.getInt(), Y = cin.getInt();
    let p1 = A * X + B * Y, p2, p3, p4;
    p2 = p3 = p4 = Number.MAX_SAFE_INTEGER
    if (X > Y) {
        p2 = Y * 2 * C + (X - Y) * A;
    } else if (X < Y) {
        p3 = X * 2 * C + (Y - X) * B;
    } else {
        p4 = (X + Y) * C;
    }
    let p5 = Math.max(X, Y) * 2 * C;
    console.log(Math.min(...[p1, p2, p3, p4, p5]));
}
class Inputer{constructor(t){if(typeof t=='undefined')throw new Error('引数（stdin）を省略できません！');this.cnt=0,this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
        "fmt"
)

func solution(a, b, c, x, y int) int {
        out := max(x, y) * c * 2

        out = min(out, a*x+b*y)

        tmp := c * 2 * min(x, y)
        t := min(x, y)
        x -= t
        y -= t

        tmp += a*x + b*y

        return min(out, tmp)
}

func min(x, y int) int {
        if x < y {
                return x
        }
        return y
}
func max(x, y int) int {
        if x > y {
                return x
        }
        return y
}

func main() {
        var a, b, c, x, y int
        fmt.Scan(&a, &b, &c, &x, &y)
        fmt.Println(solution(a, b, c, x, y))
}
//  [go]
package main

import (
	"fmt"
)

func min(n, m int) int {
	if n >= m {
		return m
	} else {
		return n
	}
}

func main() {
	var a, b, c, x, y int
	fmt.Scan(&a, &b, &c, &x, &y)
	m := min(a+b, 2*c)
	if x >= y {
		fmt.Println(y*m + (x-y)*min(a, 2*c))
	} else {
		fmt.Println(x*m + (y-x)*min(b, 2*c))
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b, c, x, y int
	fmt.Scan(&a, &b, &c, &x, &y)
	var cost int
	if c*2 < a+b {
		n := Min(x, y)
		cost += c * 2 * n
		x -= n
		y -= n
	}
	if c*2 < a {
		cost += c * 2 * x
		x = 0
	}
	if c*2 < b {
		cost += c * 2 * y
		y = 0
	}
	cost += a * x
	cost += b * y

	fmt.Println(cost)
}

func Min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b, c, x, y int
	fmt.Scanf("%d %d %d %d %d", &a, &b, &c, &x, &y)
	sum := (a * x) + (b * y)
	if x == y {
		tmp := (c * x * 2)
		if sum > tmp {
			sum = tmp
		}
	} else {
		diff := x - y
		v1 := 0
		v2 := 0
		if diff > 0 {
			v1 = (c * (x * 2))
			v2 = (c * (y * 2)) + (a * diff)
		} else {
			v1 = (c * (y * 2))
          v2 = (c * (x * 2)) + (b * int(math.Abs(float64(diff))))
		}
		if sum > v1 {
			sum = v1
		}
		if sum > v2 {
			sum = v2
		}
	}
	fmt.Println(sum)
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for C - Half and Half
	var A, B, C int
	var X, Y int
	fmt.Scanf("%d %d %d %d %d", &A, &B, &C, &X, &Y)

	var min = 1000000000
	for i := 0; i <= 100000; i++ {
		a := int(math.Max(0, float64(X-i)))
		b := int(math.Max(0, float64(Y-i)))
		cost := i*2*C + a*A + b*B
		if min > cost {
			min = cost
		}
	}

	fmt.Println(min)
}
//  [ruby]
A,B,C,X,Y=gets.split.map(&:to_i)


p1=C*(X>Y ? X : Y)*2
p2=A*X+B*Y
p3=(X>Y ? Y : X)*C*2 + (X-Y).abs*(X>Y ? A : B)

puts [p1,p2,p3].min
//  [ruby]
a,b,c,x,y = gets.split.map(&:to_i)

array=[]
array << a*x+b*y
array << 2*c*[x,y].max
if x > y
  array << 2*c*[x,y].min + (x-y) * a
else
  array << 2*c*[x,y].min + (y-x) * b
end

puts array.min
//  [ruby]
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  INF = Float::INFINITY
  def chmin(a, b) a < b ? a : b end

# 1000 2000 5000 4 3
# 1000 2000 5000 3 4
a,b,c,x,y = gets.split.map(&:to_i)

if x < y
  x,y = y,x
  a,b = b,a
end


min_mix = chmin(a+b,2*c)
min_a = chmin(a, 2*c)
s = min_mix * y + (x-y)*min_a
puts s
//  [ruby]
a, b, c, x, y = gets.chomp.split().map(&:to_i)

ans = Float::INFINITY
0.upto(2*10**5).each do |i|
  price = [a*(x-i/2), 0].max + [b*(y-i/2), 0].max + c*i
  ans = [ans, price].min
  # p [i, price, '', [a*(x-i/2), 0].max, [b*(y-i/2), 0].max, c*i]
end

puts ans
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end

a,b,c,x,y=gi
ans = []
ans << a*x + b*y
ans << x*2*c + max(0,y-x)*min(b,2*c)
ans << max(0,x-y)*min(a,2*c) + y*2*c
ans << x*a + y*b
puts ans.min
//  [ruby]
a,b,c,x,y=gets.split.map &:to_i
puts (0..[x,y].max*2).map{|i| a*[x-i/2,0].max + b*[y-i/2,0].max + c*i}.min
//  [rust]
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (A, B, C, X, Y) = read!(i64, i64, i64, i64, i64);

    let mut cost = std::i64::MAX;
    for i in 0..max(X, Y) + 1 {
        let (x, y) = (max(X - i, 0), max(Y - i, 0));
        cost = min(cost, x * A + y * B + i * C * 2);
    }

    println!("{}", cost)
}
//  [rust]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("Failed to read bytes") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a:usize = read();
    let b:usize = read();
    let c:usize = read();
    let x:usize = read();
    let y:usize = read();
    let mut ans = 0;
    ans += min(a+b, c*2) * min(x, y);
    if x > y {
        ans += min(a, c*2) * (x-y);
    } else {
        ans += min(b, c*2) * (y-x);
    }
    println!("{}", ans);
}
//  [rust]
extern crate core;

use std::io::{self, Read};

#[macro_use]
mod parser {
    macro_rules! input {
    ($s:expr=>$($t:tt)*) => {
        let mut lines=$s.split("\n");
        $(
            line_parse!(lines,$t);
        )*
    };
    }

    macro_rules! line_parse {
    ($lines:expr,($($name:ident:$t:tt)*)) => {
        let mut line=$lines.next().unwrap().split_whitespace();
        $(value_def!(line,$name,$t);)*
    };

    //複数行
    ($lines:expr,{$n:expr;$name:ident:$t:tt}) => {
        values_def!($lines,$n,$name,$t);
    };
    }

    macro_rules! value_def {
    ($line:expr,$name:ident,$t:tt) => {
        let $name=value!($line,$t);
    };
    }

    macro_rules! values_def {
    ($lines:expr,$n:expr,$name:ident,$t:tt) => {
        let $name={
        let mut vec=Vec::new();
        for i in 0..$n{
            let mut next=$lines.next().unwrap().split_whitespace();
            vec.push(value!(next,$t));
        }
        vec
        };
    };
    }

    macro_rules! value {
    //配列
    ($line:expr,[$t:tt]) => {
        $line.map(|x|{
        let mut iter=::std::iter::once(x);
        value!(iter,$t)
        }).collect::<Vec<_>>()
    };
    //タプル
    ($line:expr,($($t:tt),*)) => {
        ($(value!($line,$t),)*)
    };
    //文字列
    ($line:expr,#) => {
        $line.next().unwrap()
    };
    //単一値
    ($line:expr,$t:ty) => {
        $line.next().unwrap().parse::<$t>().unwrap()
    };
    }
}

fn main() {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();
    let output = solve(input.trim().to_string());
    println!("{}", output);
}

fn solve(input: String) -> String {
    input!(input=>(a:i64 b:i64 c:i64 x:i64 y:i64));
    if a + b < 2 * c {
        //ABのほうが高い
        a * x + b * y
    } else {
        //Aが多い
        if x > y {
            if a < 2 * c {
                (y * c) * 2 + (x - y) * a
            } else {
                2 * x * c
            }
        } else {
            if b < 2 * c {
                (x * c) * 2 + (y - x) * b
            } else {
                2 * y * c
            }
        }
    }.to_string()
}

macro_rules! tests {
    ($($name:ident: $input:expr=>$output:expr,)*) => {
        mod tests {
            $(
                #[test]
                fn $name() {
                    assert_eq!($output.trim().to_string(),super::solve($input.trim().to_string()));
                }
            )*
        }
    }
}

tests! {
    test1: "1500 2000 1600 3 2" => "7900",
    test2: "1500 2000 1900 3 2" => "8500",
    test3: "1500 2000 500 90000 100000" => "100000000",
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        a: isize, b: isize, c: isize,
        x: isize, y: isize,
    }

    let mut ans = a*x + b*y;
    let dif = c*2 - (a+b);
    let min = std::cmp::min(x, y);
    if dif < 0 {
        ans += dif * min;
        if x < y && c*2 < b {
            ans += (y-x) * (c*2 - b);
        } else if y < x && c*2 < a {
            ans += (x-y) * (c*2 - a);
        }
    }
    println!("{}", ans);
}
//  [rust]
use std::cmp::Ordering;
use whiteread::parse_line;

fn main() {
    let (a, b, c, x, y): (u32, u32, u32, u32, u32) = parse_line().unwrap();
    let mut ans;

    match x.cmp(&y) {
        Ordering::Equal => ans = 2 * c * x,
        Ordering::Greater => ans = 2 * c * y + (a * (x - y)).min(2 * c * (x - y)),
        Ordering::Less => ans = 2 * c * x + (b * (y - x)).min(2 * c * (y - x)),
    }
    ans = ans.min(a * x + b * y);
    println!("{}", ans);
}
//  [swift]
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (A, B, C, X, Y) = (input[0], input[1], input[2], input[3], input[4])
let set1 = A*X + B*Y
let set2 = C*max(X,Y)*2
let set3 = C*min(X,Y)*2 + abs(X-Y)*(X>Y ? A:B)
print(min(set1, set2, set3))
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///最大公約数を返す
func gcd(_ array: [Int]) -> Int {
    var value = array[0]
    if array.count > 1 {
        for i in 1..<array.count {
            value = gcd(value, array[i])
        }
    }
    return value
}

///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let input = readInts()
    let (a, b, c, x, y) = (input[0], input[1], input[2] * 2, input[3], input[4])
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    var ans = Int.max
    
    for i in 0...max(x, y) {
        var value = c * i
        if x > i {
            value += a * (x - i)
        }
        if y > i {
            value += b * (y - i)
        }
        ans = min(ans, value)
    }
    print(ans)
}
main()
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a, b, c, x, y] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const res = _ => {
  const totals = []

  for (let n = 0; n <= Math.max(x, y) * 2; n += 2) {
    const aCount = x - Math.abs(n / 2) >= 0 ? x - Math.abs(n / 2) : 0
    const bCount = y - Math.abs(n / 2) >= 0 ? y - Math.abs(n / 2) : 0
    const total = aCount * a + bCount * b + n * c

    totals.push(total)
  }

  return Math.min(...totals)
}

console.log(res())
//  [python]
a, b = map(int,input().split())

if(a + b == 15):
  print("+")
elif(a * b == 15):
  print("*")
else:
  print("x")
//  [python]
a,b=map(int,input().split())
if(a+b==15):
    print('+')
elif(a*b==15):
    print('*')
else:
    print('x')
//  [python]
a, b = (int(i) for i in input().split())
if a+b==15:
  print('+')
elif a*b == 15:
  print('*')
else:
  print('x')
//  [python]
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in input().split())  


if a+b == 15 :
    print("+")
elif a*b == 15:
    print("*")
else:
    print("x")
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    if a+b == 15:
        return '+'
    if a*b==15:
        return '*'

    return 'x'



print(main())
//  [python]
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = 'x'
if a+b == 15:
    ans = '+'
elif a*b == 15:
    ans = '*'
print(ans)
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	void solve() throws IOException {
		solve(ni(), ni());
	}

	private void solve(int n, int m) {
		out.println((n + m == 15) ? "+" : (n * m == 15) ? "*" : "x");

	}

	String ns() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine(), " ");
		}
		return tok.nextToken();
	}

	int ni() throws IOException {
		return Integer.parseInt(ns());
	}

	long nl() throws IOException {
		return Long.parseLong(ns());
	}

	double nd() throws IOException {
		return Double.parseDouble(ns());
	}

	String[] nsa(int n) throws IOException {
		String[] res = new String[n];
		for (int i = 0; i < n; i++) {
			res[i] = ns();
		}
		return res;
	}

	int[] nia(int n) throws IOException {
		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			res[i] = ni();
		}
		return res;
	}

	long[] nla(int n) throws IOException {
		long[] res = new long[n];
		for (int i = 0; i < n; i++) {
			res[i] = nl();
		}
		return res;
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		tok = new StringTokenizer("");
		Main main = new Main();
		main.solve();
		out.close();
	}
}
//  [java]
import java.io.IOException; 
import java.io.InputStream; 
import java.io.PrintWriter; 

class Main{ 

	static void solve(){ 
		int a = ni();
		int b = ni();
		if(a+b==15)out.println("+");
		else if(a*b==15)out.println("*");
		else out.println("x");
	} 
 
 
 
 
	public static void main(String[] args){ 
		 solve(); 
		 out.flush(); 
	 } 
	 private static InputStream in = System.in; 
	 private static PrintWriter out = new PrintWriter(System.out); 
 
	 private static final byte[] buffer = new byte[1<<15]; 
	 private static int ptr = 0; 
	 private static int buflen = 0; 
	 private static boolean hasNextByte(){ 
		 if(ptr<buflen)return true; 
		 ptr = 0; 
		 try{ 
			 buflen = in.read(buffer); 
		 } catch (IOException e){ 
			 e.printStackTrace(); 
		 } 
		 return buflen>0; 
	 } 
	 private static int readByte(){ if(hasNextByte()) return buffer[ptr++]; else return -1;} 
	 private static boolean isSpaceChar(int c){ return !(33<=c && c<=126);} 
	 private static int skip(){int res; while((res=readByte())!=-1 && isSpaceChar(res)); return res;} 
 
	 private static double nd(){ return Double.parseDouble(ns()); } 
	 private static char nc(){ return (char)skip(); } 
	 private static String ns(){ 
		 StringBuilder sb = new StringBuilder(); 
		 for(int b=skip();!isSpaceChar(b);b=readByte())sb.append((char)b); 
		 return sb.toString(); 
	 } 
	 private static int[] nia(int n){ 
		 int[] res = new int[n]; 
		 for(int i=0;i<n;++i)res[i]=ni(); 
		 return res; 
	 } 
	 private static long[] nla(int n){ 
		 long[] res = new long[n]; 
		 for(int i=0;i<n;++i)res[i]=nl(); 
		 return res; 
	 } 
	 private static int ni(){ 
		 int res=0,b; 
		 boolean minus=false; 
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-')); 
		 if(b=='-'){ 
			 minus=true; 
			 b=readByte(); 
		 } 
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0'); 
		 return minus ? -res:res; 
	 } 
	 private static long nl(){ 
		 long res=0,b; 
		 boolean minus=false; 
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-')); 
		 if(b=='-'){ 
			 minus=true; 
			 b=readByte(); 
		 } 
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0'); 
		 return minus ? -res:res; 
	} 
}