A new delivery of clothing has arrived today to the clothing store. This delivery consists of $a$ ties, $b$ scarves, $c$ vests and $d$ jackets.

The store does not sell single clothing items — instead, it sells suits of two types:  a suit of the first type consists of one tie and one jacket;  a suit of the second type consists of one scarf, one vest and one jacket. 

Each suit of the first type costs $e$ coins, and each suit of the second type costs $f$ coins.

Calculate the maximum possible cost of a set of suits that can be composed from the delivered clothing items. Note that one item cannot be used in more than one suit (though some items may be left unused).


-----Input-----

The first line contains one integer $a$ $(1 \le a \le 100\,000)$ — the number of ties.

The second line contains one integer $b$ $(1 \le b \le 100\,000)$ — the number of scarves.

The third line contains one integer $c$ $(1 \le c \le 100\,000)$ — the number of vests.

The fourth line contains one integer $d$ $(1 \le d \le 100\,000)$ — the number of jackets.

The fifth line contains one integer $e$ $(1 \le e \le 1\,000)$ — the cost of one suit of the first type.

The sixth line contains one integer $f$ $(1 \le f \le 1\,000)$ — the cost of one suit of the second type.


-----Output-----

Print one integer — the maximum total cost of some set of suits that can be composed from the delivered items. 


-----Examples-----
Input
4
5
6
3
1
2

Output
6

Input
12
11
13
20
4
6

Output
102

Input
17
14
5
21
15
17

Output
325



-----Note-----

It is possible to compose three suits of the second type in the first example, and their total cost will be $6$. Since all jackets will be used, it's impossible to add anything to this set.

The best course of action in the second example is to compose nine suits of the first type and eleven suits of the second type. The total cost is $9 \cdot 4 + 11 \cdot 6 = 102$.

Difficulty: interview

Starter code:

Solutions:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
if e>=f:
    ans=min(a,d)
    d-=ans
    a-=ans
    ans*=e
    ans+=min(d,b,c)*f
else:
    ans=min(d,b,c)
    d-=ans
    ans*=f
    ans+=min(a,d)*e
print(ans)

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())

if(e>=f):
    ans=min(a,d)*e
    d-=min(a,d)
    ans+=min(min(b,c),d)*f
    print(ans)
else:
    ans=min(min(b,c),d)*f
    d-=min(min(b,c),d)
    ans+=min(a,d)*e
    print(ans)


import sys
input = sys.stdin.readline

def getInt(): return int(input())
def getVars(): return list(map(int, input().split()))
def getList(): return list(map(int, input().split()))
def getStr(): return input().strip()

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

a = getInt()
b = getInt()
c = getInt()
d = getInt()
e = getInt()
f = getInt()
res = 0
if (e > f):
    res += min(a, d) * e
    res += min(b, c, d-min(a, d)) * f
else:
    res += min(b, c, d) * f
    res += min(a, d - min(b, c, d))*e
print(res)


a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
ans = 0
if f > e:
    ans += min(d,c,b)*f
    d -= min(d,c,b)
    ans += min(a,d)*e
else:
    ans += min(a,d)*e
    d -= min(a,d)
    ans += min(b,c,d)*f
print(ans)

#!/usr/bin/env python3
# coding: utf-8
# Last Modified: 15/Dec/19 02:48:07 PM


import sys


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    f = int(input())
    ans = 0
    if e > f:
        ans = e * min(a, d)
        x = min(a, d)
        a -= x
        d -= x
        ans += f * min(b, c, d)
        print(ans)
    else:
        ans += f * min(b, c, d)
        x = min(b, c, d)
        b -= x
        c -= x
        d -= x
        ans += e * min(a, d)
        print(ans)


get_array = lambda: list(map(int, sys.stdin.readline().split()))


get_ints = lambda: list(map(int, sys.stdin.readline().split()))


input = lambda: sys.stdin.readline().strip()


def __starting_point():
    main()

__starting_point()

a, b, c, d, e, f = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
if e >= f:
    print(min(a, d)*e+min(d-min(a, d), b, c)*f)
else:
    print(min(b, c, d)*f+min(d-min(b, c, d), a)*e)


a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
if e>=f:
    ans=e*min(a,d)
    k=min(a,d)
    a -= k
    d -= k
    ans += f*min(b,c,d)
    print(ans)
else:
    ans=f*min(b,c,d)
    k=min(b,c,d)
    b -= k
    c -= k
    d -= k
    ans += e*min(a,d)
    print(ans)

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
ans = 0

if e > f:
    ans += e * min(a, d)
    d -= min(a, d)
    ans += f * min(b, c, d)
else:
    ans += f * min(b, c, d)
    d -= min(b, c, d)
    ans += e * min(a, d)

print(ans)


a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
if f>e:
	print (min(b,c,d)*f+(min(a,d-min(b,c,d))*e))
else:
	print (min(a,d)*e+min(b,c,d-min(a,d))*f)

import sys
def main():
    a,b,c,d,e,f = list(map(int, sys.stdin.read().split()))
    ans = 0

    for i in range(0, d+1):
        t1 = min(a, i)
        t2 = min(b, c, d-i)

        if ans < t1 * e + t2 * f:
            ans = t1 * e + t2 * f

    print(ans)

main()


a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

if e > f:
    ans = e * min(a, d)
    d -= min(a, d)
    ans += f * min(b, c, d)
    print(ans)
else:
    ans = f * min(b, c, d)
    d -= min(b, c, d)
    ans += e * min(a, d)
    print(ans)


a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
ans=0
if(f>e):
    m=min(b,c,d)
    ans+=m*f
    d-=m
    m=min(d,a)
    ans+=m*e
else:
    m=min(d,a)
    ans+=m*e
    d-=m
    m=min(b,c,d)
    ans+=m*f
print(ans)

# cost e, a,d
# cost f, b,c,d

a,b,c,d,e,f = [int(input()) for i in range(6)]

q = min(a,d)
dd = d-q
ans = e*q + f*min(b,c,dd)

w = min(b,c,d)
dd = d-w
ans = max(ans, e*min(a,dd)+f*w)

print(ans)

a,b,c,d,e,f=[int(input())for _ in range(6)]
ans=0
if e>f:
  m=min(a,d)
  ans+=e*m
  d-=m
  print(ans+min(b,c,d)*f)
else:
  m=min(b,c,d)
  ans+=f*m
  d-=m
  print(ans+min(a,d)*e)