CodeEff/ECCO huggingface dataset:
# Original solution
import sys
 
N=int(eval(input()))
for i in range(1,10):
  if N/i==N//i  and N/i<10:
    print("Yes")
    sys.exit()
print("No")

# Optimized solution
n=int(eval(input()))
 
a=[]
for i in range(1,10):
	if n/i<10 and n%i==0:
		a.append("Yes")
 
if "Yes" in a:
  print("Yes")
else:
  print("No")
# Original solution
n = int(eval(input()))
ans = 0
for i in range(1,10):
  if n%i==0 and n//i<10:
    ans = 1
print(('Yes' if ans else 'No'))

# Optimized solution
n=int(eval(input()))
a='No'
for i in range(1,10):
  if n%i==0 and n//i<10: a='Yes'
print(a)
# Original solution
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()

# int(input())
# map(int, input().split())

n = int(eval(input()))

st = {i * j for i in range(1, 10) for j in range(1, 10)}

if n in st:
    print('Yes')
else:
    print('No')


# Optimized solution
def main():
    N = int(eval(input()))

    def check():
        for i in range(1, 10):
            for j in range(1, 10):
                if i * j == N:
                    return True
        return False

    cond = check()

    print(('Yes' if cond else 'No'))


if __name__ == '__main__':
    main()
# Original solution
N=int(eval(input()))
flag=False
for i in range(1,10):
    m=N/i
    if m.is_integer() and 1<=m<=9:
        flag=True
        break
print(("Yes" if flag else "No"))

# Optimized solution
N=int(eval(input()))
for i in range(1,10):
    m=N/i
    if m.is_integer() and 1<=m<=9:
        print("Yes")
        break
else:
    print("No")
# Original solution
ans = "No"
N = int(eval(input()))
for i in range(1, 10):
    temp = N / i
    if 1 <= temp <= 9 and temp % 1 == 0:
        ans = "Yes"
        break
print(ans)

# Optimized solution
N = int(eval(input()))
ans = "No"
for i in range(1, 10):
    if N // i < 10 and (N // i) * i == N:
        ans = "Yes"
print(ans)
# Original solution
n = int(eval(input()))

lis = []
for i in range(10):
  for j in range(i,10):
    lis.append(i*j)
    
if n in lis: print('Yes')
else: print('No')

# Optimized solution
n = int(input())

qq = []
for i in range(1,10):
  for j in range(1,10):
    if i*j not in qq:
      qq.append(i*j)

print('Yes') if n in qq else print('No')
# Original solution
n = int(eval(input()))
for i in range(1,10):
    if n % i == 0 and 1 <= n // i <= 9:
        print('Yes')
        exit()
print('No')

# Optimized solution
n = int(eval(input()))
for i in range(9,0, -1):
    if n % i == 0 and 1 <= n // i <= 9:
        print('Yes')
        exit()
print('No')
# Original solution
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()

    for i in range(1, 10):
        for j in range(1, 10):
            if i * j == N:
                print('Yes')
                exit()
    else:
        print('No')


if __name__ == '__main__':
    main()


# Optimized solution
N=int(eval(input()))
for i in range(1,10):
    m=N/i
    if m.is_integer() and 1<=m<=9:
        print("Yes")
        break
else:
    print("No")
# Original solution
x = int(eval(input()))
count =0

for n in range(1, 10):
    for k in range(1, 10):
        a = n * k
        if a == x:
            count += 1
            break
        else:
            pass
if count > 0:
    print('Yes')
else:
    print('No')

# Optimized solution
x = int(eval(input()))
count =0

for n in range(1, 10):
    for k in range(1, 10):
        a = n * k
        if a == x:
            print('Yes')
            exit()
        else:
            pass
print('No')
# Original solution
x = int(eval(input()))
count =0

for n in range(1, 10):
    for k in range(1, 10):
        a = n * k
        if a == x:
            print('Yes')
            exit()
        else:
            pass
print('No')

# Optimized solution
x = int(eval(input()))

for n in range(1, 10):
    for k in range(1, 10):
        a = n * k
        if a == x:
            print('Yes')
            exit()
        else:
            pass
print('No')
# Original solution
n = int(eval(input()))


def judge(n):
    for i in range(1, 10):
        for j in range(1, 10):
            if n == i * j:
                print("Yes")
                return

    print("No")


judge(n)

# Optimized solution
n = int(eval(input()))

for i in range(1,10):
    if n % i == 0 and n / i <= 9:
        print("Yes")
        quit()

print("No")
# Original solution
N=int(eval(input()))
cnt=0
if 1<=N<10:
  cnt+=1
elif N>81:
  pass
else:
  for i in range(2,10):
    if N%i==0 and (N/i)<10:
      cnt+=1
if cnt==0:
  print("No")
else:
  print("Yes")

# Optimized solution
N = int(eval(input()))
cnt = 0
for i in range(1,10):
  if N % i == 0 and 1<=N/i<=9:
    cnt = 1
    break
  
if cnt == 1:
  print("Yes")
else:
  print("No")
# Original solution
import sys


def solve():
    sys.setrecursionlimit(2000)
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    for i in range(1, 10):
        for j in range(1, 10):
            if n == i * j:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    for i in range(1, 10):
        for j in range(1, 10):
            if i * j == n:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    solve()
# Original solution
n = int(eval(input()))
list = list(range(9, 1, -1))
ans = 0
flag = 1

if n > 1:
    while n > 1:
        for i in list:
            if n % i == 0:
                n = n / i
                ans += 1
                flag = 0
                break

        if flag == 1:
            ans = 0
            break
elif n == 1:
    ans = 2

if 0 < ans <= 2:
    print("Yes")
else:
    print("No")


# Optimized solution
n = int(eval(input()))
list = list(range(9, 1, -1))
ans = 0

if n > 1:
    while n > 1:
        flag = 1
        for i in list:
            if n % i == 0:
                n = n / i
                ans += 1
                flag = 0
                break

        if flag == 1:
            ans = 0
            break
elif n == 1:
    ans = 2

if 0 < ans <= 2:
    print("Yes")
else:
    print("No")
# Original solution
num = int(eval(input()))

n = 1
while n < 10:
  if num % n == 0 and num // n < 10:
    print('Yes')
    break
    
  n += 1
    
if n == 10:
  print('No')

# Optimized solution
c = int(eval(input()))
n = 0

for i in range(1,10):
    if c /i < 10 and c %i ==0:
        n += 1
    
ans = 'Yes' if n >= 1 else 'No' 
print(ans)
# Original solution
N=int(eval(input()))

list=[]
for i in range(1,10):
  for j in range(1,10):
    list.append(i*j)
if N in list:
  print("Yes")
else:
  print("No")

# Optimized solution
n=int(eval(input()))

xlist=[]
for a in range(10):
    for b in range(10):
        xlist.append(a*b)

if n in xlist:
    print("Yes")
else:
    print("No")
# Original solution
N=int(eval(input()))
a=True 
while a:  
  for i in range(1,10):
    for j in range(1,10):
      if N==i*j:
          print("Yes")
          break
    if N==i*j:
      break
  if N==i*j:
    break
  print("No")
  a=False

# Optimized solution
"""
制約
1≦N≦100
Nは整数
"""

#入力
N = int(eval(input()))

#九九リストの作成
list = []
for i in range(1, 10):
  for j in range(1, 10):
    list.append(i * j) #リストに追加　list.append()

#リスト内にNが存在するかどうかで判別＆出力
if N in list:
  print("Yes")
else:
  print("No")
# Original solution
N = int(eval(input()))
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9]
C = [x * y for x in a for y in b ]

if N in C:
    print("Yes")
else:
    print("No")

# Optimized solution
N = int(eval(input()))
kuku = [x * y for x in range(1,10) for y in range(1, 10)]
if N in kuku:
    print("Yes")
else:
    print("No")
# Original solution
import sys
N = int(eval(input()))
a = 1
b = 1
if (N == 1)or(N == 81):
    print("Yes")
elif (2 <= N <= 80):
    for a in range(1,10):
        for b in range(1,10):
            if N == a*b:
                print("Yes")
                sys.exit()
            else:
                None
    print("No")
    sys.exit()
elif 82 <= N:
    print("No")

# Optimized solution
N = int(eval(input()))
ans = 0
for a in range(1,10):
    for b in range(1,10):
        if N == a*b:
            ans = 1
if (ans == 1):
    print("Yes")
else:
    print("No")
# Original solution
N = int(eval(input()))

l = []
for i in range(1, 10):
    for j in range(1, 10):
        l.append(i * j)

if N in l:
    print('Yes')
else:
    print('No')

# Optimized solution
x = int(eval(input()))
ans = "No"
for i in range(1,10):
    for j in range(1,10):
        if i*j==x:
            ans = "Yes"
print(ans)
# Original solution
n = int(eval(input()))
t = 0

for i in range(9):
  for j in range(9):
    if n == (i + 1) * (j + 1):
      t += 1
      
if t == 0:
  print('No')
else:
  print('Yes')

# Optimized solution
n = int(eval(input()))
for i in range(1, 10):
    if n % i == 0:
        if n / i <= 9:
            print("Yes")
            break
else:
    print("No")
# Original solution
import sys
a = 1

for i in sys.stdin:
        x = i.strip()
        if x == "0":
                break;
        print(("Case {}: {}".format(a,x)))
        a += 1

# Optimized solution
import sys
a = 1

for i in sys.stdin:
        x = i.strip()
        if x == "0":
                break;
        print(("Case {0}: {1}".format(a,x)))
        a += 1
# Original solution
import sys

i = 1
for line in sys.stdin.readlines():
    x = line.strip()
    if x != "0":
        print(("Case {}: {}".format(i, x)))
    i += 1

# Optimized solution
import sys

i = 1
for line in sys.stdin.readlines():
    x = line.strip()
    if x == "0":
        break
    print(("Case {}: {}".format(i, x)))
    i += 1
# Original solution
i = 1
while True :
    x = eval(input())
    if (x == 0) :
        exit()
    print("Case %d: %d" % (i, x))
    i += 1

# Optimized solution
i = 1
while True :
    x = eval(input())
    if (x == 0) :
        break
    print("Case %d: %d" % (i, x))
    i += 1
# Original solution
i=1
while True:
 n=eval(input())
 if int(n)==0:break
 print(f'Case {i}: {n}')
 i+=1

# Optimized solution
a=[]
b=a.append
while True:
 n=eval(input())
 if int(n)==0:break
 b(n)
for i in range(len(a)):print(f'Case {i+1}: {a[i]}')
# Original solution
i=1
while 1:
 a=eval(input())
 if int(a)==0:break
 print(f'Case {i}: {a}')
 i+=1

# Optimized solution
import sys
i=1
for a in sys.stdin:
 if a=='0\n':break
 print(f'Case {i}: {a.strip()}')
 i+=1
# Original solution
for i,a in enumerate(iter(input,'0')):print(f'Case {i+1}: {a}')


# Optimized solution
import sys
i=1
for i,a in enumerate(sys.stdin):
 a=a.strip()
 if a=='0':break
 print(f'Case {i+1}: {a}')
# Original solution
for i,a in enumerate(iter(input,'0'),1):print(f'Case {i}: {a}')


# Optimized solution
import sys
for i,a in enumerate(sys.stdin,1):
 if a=='0\n':break
 print(f'Case {i}: {a}',end='')
# Original solution
i = 1
n = 1
while n != 0:
	n = int(input())
	if n == 0:
		continue
	print("Case %d: %d" %(i, n))
	i += 1

# Optimized solution
cases = []
n = 1
while n != 0:
	n = int(input())
	if n == 0:
		continue
	cases.append(n)


for i in range(len(cases)):
	print("Case %d: %d" %(i + 1, cases[i]))
# Original solution
s = 1
while True:
	t = int(eval(input()))
	if t == 0:
		break
	else:
		print(("Case "+str(s)+": "+str(t)))
	s += 1

# Optimized solution
t = 1
while True:
	s = int(eval(input()))
	if (s == 0):
		break
	else:
		print(("Case " + str(t) + ": " + str(s)))
		t += 1
# Original solution
t = 1
while True:
	s = int(eval(input()))
	if (s == 0):
		break
	else:
		print(("Case " + str(t) + ": " + str(s)))
		t += 1

# Optimized solution
i = 1
while True:
	t = int(eval(input()))
	if (t == 0):
		break
	else:
		print(("Case" + " " + str(i) + ":" + " " +str(t)))
		i = i + 1
# Original solution
i = 1
while 1:
	x = int(eval(input()))
	if x == 0:
		break
	print(("Case " + str(i) + ": " + str(x)))
	i = i + 1

# Optimized solution
i = 0
while True:
	x = int(eval(input()))
	if x == 0: break
	i = i + 1
	print(("Case " + str(i) + ": " + str(x)))
# Original solution
# coding: utf-8
import sys

line = sys.stdin

count = 1
for x in line :
	if int(x) == 0 :
		break
	print('Case {0}: {1}'.format(count, x), end='')
	count += 1


# Optimized solution
# coding: utf-8
import sys

line = sys.stdin

count = 1
for x in line :
	if int(x) == 0 :
		break
	print(('Case {0}: {1}'.format(count, x.strip())))
	count += 1
# Original solution
i = 1
while 1:
	x = eval(input())
	if x == 0:
		break
	print('Case %d: %d' % (i, x))
	i+=1

# Optimized solution
i = 1
while 1:
	x = input()
	if x == '0':
		break
	print('Case %d: %s' % (i, x))
	i+=1
# Original solution
i = 0
while 1:
    i+=1
    v = input()
    if v == '0':
       break
    print(('Case {}: {}'.format(i,v)))

# Optimized solution
i = 0
while 1:
    i+=1
    x = input()
    if x == '0':
       break
    print(('Case {}: {}'.format(i,x)))
# Original solution
i=1
while True:
    n=eval(input())
    if not n:
        break
    print("Case %d: %d"%(i,n))
    i+=1

# Optimized solution
import sys


def resolve():
    idx = 1
    for num_s in sys.stdin:
        num = int(num_s)
        if num == 0:
            break
        print(("Case {}: {}".format(idx, int(num))))
        idx += 1


resolve()
# Original solution
import sys

i=1
while True:
	x = int( sys.stdin.readline() )
	if 0 != x:
		print(( "Case {}: {}".format( i, x) ))
	else:
		break
	i += 1

# Optimized solution
import sys

i=1
while True:
    x = sys.stdin.readline().rstrip() 
    if "0" != x:
        print(( "Case {}: {}".format( i, x) ))
    else:
        break
    i += 1
# Original solution
c = 0
while True:
    x = int(eval(input())); c += 1
    if x == 0: break
    print(("Case {}: {}".format(c, x)))


# Optimized solution
# -*- coding: utf-8 -*-
c = 1
while True:
    n = int(eval(input()))
    if n == 0:
        break
    print(('Case {0}: {1}'.format(c, n)))
    c += 1
# Original solution
array = []
while True:
    x= eval(input())
    if x == 0:
    	break
    array.append(x)

for i in range(len(array)):
	print(('Case {0}: {1}'.format(i+1,array[i])))

# Optimized solution
import sys
a = sys.stdin
i = 1
for line in a:
    if(int(line) == 0):
        break
    print('Case {0}: {1}'.format(i,line),end="")
    i += 1
# Original solution
count = 0
for i in range(10000):
  a = eval(input())
  a = int(a)
  if a > 0:
    count += 1
    print(('Case '+str(count)+': '+str(a)))
  else:
    break


# Optimized solution
count=1
while True:
    a=eval(input())
    a=int(a)
    if a==0:
        break
    print(("Case {}: {}".format(count,a)))
    count+=1
# Original solution
if __name__ == '__main__':
    current_no = 1
    while True:
        input_num = int(eval(input()))

        if input_num != 0:
            print(('Case {0}: {1}'.format(current_no, input_num)))
            current_no += 1
        else:
            break

# Optimized solution
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_B&lang=jp

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    count = 1
    while True:
        x = int(eval(input()))
        if x == 0:
            break
        print(('Case {}: {}'.format(count, x)))
        count += 1


if __name__ == '__main__':
    main(sys.argv[1:])
# Original solution
c = 0
while True:
    a = eval(input())
    if a == 0: break
    c += 1
    print('Case %d: %d' %(c, a))

# Optimized solution
c = 0
while True:
    a = int(input())
    if a == 0: break
    c += 1
    print('Case %d: %d' %(c, a))
# Original solution
i = 1
a = eval(input())
while a != 0:
	print("Case %d: %d" % (i, a))
	i = i + 1
	a = eval(input())

# Optimized solution
lis = []
a = int(input())
while a != 0:
 lis.append(a)
 a = int(input())

for i,v in enumerate(lis):
 print("Case %d: %d" % (i+1,v))
# Original solution
lis = []
a = int(input())
while a != 0:
 lis.append(a)
 a = int(input())

for i,v in enumerate(lis):
 print("Case %d: %d" % (i+1,v))

# Optimized solution
lis = []
a = input()
while a != '0':
 lis.append(a)
 a = input()

for i,v in enumerate(lis):
 print("Case %d: %s" % (i+1,v))
# Original solution
A, B, C, X, Y = list(map(int,input().split()))
ans = 0
mi = min(X, Y); ma = max(X, Y); sub = abs(X - Y);

price = 0
if max(X, Y) == X:
  price = A
else:
  price = B
part_c = 2*C*mi + sub*price

print((min(2*C*ma, part_c, A*X + B*Y)))

# Optimized solution
A, B, C, X, Y = list(map(int,input().split()))
s1 = 2*C*max(X, Y)
s2 = 2*C*min(X, Y) + A*(X-min(X,Y)) + B*(Y-min(X,Y))
s3 = A*X + B*Y
print((min(s1,s2,s3)))
# Original solution
A, B, C, X, Y = list(map(int, input().split()))

min_sum = 9999999999
for a in range(X+1):
    for b in range(Y+1):
        c = max(X-a, Y-b)
        sum = A*a + B*b + 2*C*c
        if sum<min_sum:
            min_sum=sum
print(min_sum)

# Optimized solution
a, b, c, x, y = list(map(int, input().split()))

res = a*x + b*y # 条件を満たす買い方のうちABピザの枚数(*2)を全探索する。ABピザを一切買わない場合を一旦答えにする（これを大きい値にして、for ループを0からにしてもよい）
for i in range(1, max(x, y)+1): # 全部ABピザでまかなう時は x,yの内多い方分買うことになる
    ab = i*2 # ABピザを買う枚数奇数枚買うことはないので2倍
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i) # i枚分はABピザになるので-i 負の値にはならない（あまりになる）ので0とのmaxをとる

    res = min(res, cand) # 候補との最小値を保持

print(res)
# Original solution
import sys
A, B, C, X, Y = list(map(int, sys.stdin.readline().split(" ")))
ans = float("inf")
 
for i in range(X + 1):
    for j in range(Y + 1):
        k = max(X - i, Y - j) * 2
        ans = min(ans, A * i + B * j + C * k)
print(ans)

# Optimized solution
import sys
A, B, C, X, Y = list(map(int, sys.stdin.readline().split(" ")))
ans = float("inf")
 
for i in range(max(X, Y) * 2 + 1):
    j = X - i // 2
    if j < 0:
        j = 0
    k = Y - i // 2
    if k < 0:
        k = 0
    ans = min(ans, C * i + A * j + B * k)
print(ans)
# Original solution
# Problem: https://atcoder.jp/contests/arc096/tasks/arc096_a
# Python 1st Try

import sys
# from collections import defaultdict
# import heapq,copy
import pprint as pp
# from collections import deque
def II(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


# CONST
MAXSIZE = ( 1 << 31 ) -1
MINSIZE = -( 1 << 31) + 1

def solver(a_price, b_price, c_price, target_x, target_y):
    result = MAXSIZE
    for mix_i in range(0, 2 * 10**5+1, +1):
        a_i = target_x - mix_i//2
        b_i = target_y - mix_i//2
        totalPrice = max(a_i, 0) * a_price + max(b_i,0) * b_price + mix_i * c_price
        if totalPrice < result:
            # print("A={},B={},C={} -> total = {}".format(a_i, b_i, mix_i, totalPrice))
            result = totalPrice
    return result


if __name__ == "__main__":
    A, B, C, X, Y = MI()
    print(("{}".format(solver(A, B, C, X, Y))))


# Optimized solution
# Problem: https://atcoder.jp/contests/arc096/tasks/arc096_a
# Python 2nd Try

import sys
# from collections import defaultdict
# import heapq,copy
import pprint as pp
# from collections import deque
def II(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


# Const
MAXSIZE = ( 1 << 31 ) -1
MINSIZE = -( 1 << 31) + 1
MAXSHEET = 10**5

def solver(a_price, b_price, ab_price, x_sheet , y_sheet):
    result = MAXSHEET*a_price+MAXSHEET*b_price
    for j in range(0, 2*MAXSHEET+1, 2):
        a_buy_sheet = max(x_sheet-j//2,0)
        b_buy_sheet = max(y_sheet - j//2, 0 )
        total = ( a_buy_sheet*a_price + b_buy_sheet*b_price +
                                         j*ab_price )
#       print("total={}".format(total))
        check = ( total < result )
        if check:
#           print("値は{}に".format(total))
            result = total
    return result


if __name__ == "__main__":
    a_price, b_price, ab_price, x_sheet , y_sheet = MI()
    print(("{}".format(solver(a_price, b_price,
                             ab_price, x_sheet, y_sheet))))
# Original solution
a,b,c,x,y = list(map(int, input().split()))
ans = float('inf')

for i in range(10**5+1):
    tmp = i*2*c + max(0, x-i)*a + max(0, y-i)*b
    if ans > tmp:
        ans = tmp
print(ans)

# Optimized solution
a,b,c,x,y = list(map(int, input().split()))
ans = float('inf')

for i in range(10**5+1):
    tmp = i*2*c
    if i>=x:
        pass
    else:
        tmp += (x-i)*a
    if i>=y:
        pass
    else:
        tmp += (y-i)*b
    if ans > tmp:
        ans = tmp

print(ans)
# Original solution
A, B, C, X, Y = list(map(int, input().split()))
m_value = float('inf')
for ab in range(max(X, Y) + 1):
    ab2 = 2 * ab
    a = X - ab
    b = Y - ab
    tmp = C * ab2
    if a > 0:
        tmp += a * A
    if b > 0:
        tmp += b * B
    m_value = min(m_value, tmp)
print(m_value)


# Optimized solution
"""
O(1)解法
以下の3つから一番安いものを選ぶ
1. AピザとBピザをそれぞれ必要数買う場合
2. ABピザを必要数の多いピザ基準で買う場合 (2倍必要になることを忘れない)
3. ABピザを必要数の少ないピザ基準で買い、不足分のピザを買い足す場合
"""
A, B, C, X, Y = list(map(int, input().split()))
# Aピザの必要数がBピザよりも多くなるように、必要数と値段を入れ替える
if X < Y:
    X, Y = Y, X
    A, B = B, A
p1 = A * X + B * Y  # 1
p2 = 2 * C * X  # 2
p3 = 2 * C * Y + (X - Y) * A  # 3
print((min(p1, p2, p3)))
# Original solution
a,b,c,x,y=[int(i) for i in input().split()]

sum_list=[]


max_c=max(x,y)

#ABセットをi組頼む
for i in range(max_c+1):
    
    #Cのみ
    if i>=x and i>=y:
        sum=2*c*i
        
    #CとA
    elif i<x and i>=y:
        sum=2*c*i+a*(x-i)
    
    #CとB   
    elif i>=x and i<y:
        sum=2*c*i+b*(y-i)
    
    #CとAとB
    else:
        sum=2*c*i+a*(x-i)+b*(y-i)
        
    sum_list.append(sum)
    
    
print((min(sum_list)))

# Optimized solution
a,b,c,x,y=list(map(int, input().split()))

#cのセット数の最大値
cmax=max(x,y)

t_list=[]

#cを何セット買うか
for i in range(cmax+1):
    if x>=i and y>=i:
        total=c*2*i+a*(x-i)+b*(y-i)
        
    elif x>=i and y<i:
        total=c*2*i+a*(x-i)
        
    else:
        total=c*2*i+b*(y-i)
        
    t_list.append(total)
    
print((min(t_list)))
# Original solution
a,b,c,x,y = list(map(int, input().split()))
ans = float('inf')
for i in range(10**5+1):
    minNum = c * i * 2 + max(0,x-i) * a + max(0,y-i) * b
    if ans > minNum:
        ans = minNum
print(ans)

# Optimized solution

A, B, C, X, Y = list(map(int, input().split()))
ans = A*X+B*Y
# ABセットを全探索する
for i in range(1, max(X,Y)+1):
    # i > Xであれば買い増す必要はないが、i < Xであれば必要なため
    ans = min(ans, A*max(X-i,0)+B*max(Y-i,0)+C*2*i)
print(ans)
# Original solution
A,B,C,X,Y=list(map(int,input().split()))
ans=10**12
for i in range(10**5+1):
  temp=i*2*C+max(0,X-i)*A+max(0,Y-i)*B
  ans=min(ans,temp)
print(ans)


# Optimized solution
A,B,C,X,Y=list(map(int,input().split()))
ans=0
if 2*C<A+B:
  Z=min(X,Y)
  X-=Z
  Y-=Z
  ans+=2*C*Z
A=min(A,2*C)
B=min(B,2*C)
ans+=A*X
ans+=B*Y
print(ans)
# Original solution
A, B, C, X, Y = tuple(map(int, input().split()))

# 大きな値で初期化
TOTAL_MIN = A * X + B * Y + C * (X+Y) * 2

if 2 * C < A:
    i_max = 0
else:
    i_max = X
if 2 * C < B:
    j_max = 0
else:
    j_max = Y

for i in range(i_max + 1):
    for j in range(j_max + 1):
        k = max(X - i, Y - j) * 2
        total_tmp = A * i + B * j + C * k
        if total_tmp < TOTAL_MIN:
            TOTAL_MIN = total_tmp

print(TOTAL_MIN)


# Optimized solution
A, B, C, X, Y = tuple(map(int, input().split()))

# 大きな値で初期化
TOTAL_MIN = A * X + B * Y + C * (X+Y) * 2

for a in range(X + 1):
    c = (X - a) * 2
    if c // 2 < Y:
        if B < 2 * C:
            b = Y - c // 2
        else:
            b = 0
            c = max(c, Y * 2) 
    else:
        b = 0
    
    total_tmp = A * a + B * b + C * c
    if total_tmp < TOTAL_MIN:
        TOTAL_MIN = total_tmp
        

print(TOTAL_MIN)