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 ≤ a ≤ 100 000) — the number of ties.

The second line contains one integer b (1 ≤ b ≤ 100 000) — the number of scarves.

The third line contains one integer c (1 ≤ c ≤ 100 000) — the number of vests.

The fourth line contains one integer d (1 ≤ d ≤ 100 000) — the number of jackets.

The fifth line contains one integer e (1 ≤ e ≤ 1 000) — the cost of one suit of the first type.

The sixth line contains one integer f (1 ≤ f ≤ 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 ⋅ 4 + 11 ⋅ 6 = 102.
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

/* Name of the class has to be "Main" only if the class is public. */


public class Codechef
{
    static int mod=1000000007;
    static FastReader sc=new FastReader();
    
    
    //input (int)
    static int i() 
    {
    	 return sc.nextInt();
    }
    
    //input (string)
     static String s() {
    	 return sc.next();
    }
    
    //input (long)
    static long l() 
    {
    	 return sc.nextLong();
    }  
    
    //printing ln int
    static void println(int a)
    {
        System.out.println(a);
    }
    
    //printing int
    static void print(int a)
    {
        System.out.print(a+" ");
    }
    
    //printing ln long
    static void println(long a)
    {
        System.out.println(a);
    }
    
    //printing long
    static void print(long a)
    {
        System.out.print(a+" ");
    }
    
    //printing string ln
    static void println(String a)
    {
        System.out.println(a);
    }
    
    //printing String
    static void print(String a)
    {
        System.out.print(a+" ");
    }
    
    //printing array elements(int )
    static void print(int A[]) 
    {
    	for(int i=0;i<A.length;i++)
    		System.out.print(A[i]+" ");
    	System.out.println();
    }
    
     //printing array elements(long)
    static void print(long A[]) 
    {
    	for(int i=0;i<A.length;i++)
    		System.out.print(A[i]+" ");
    	System.out.println();
    }
    
    //printing array elements(String)
    static void print(String A[]) 
    {
    	for(int i=0;i<A.length;i++)
    		System.out.print(A[i]+" ");
    	System.out.println();
    }
    
    
    //taking input in an array of size n(int)
    static int[] input(int n) 
    {
	int A[]=new int[n];
	   for(int i=0;i<n;i++) 
		   A[i]=sc.nextInt();
	   return A;
    }
    
     // taking input in an array of size n(long)
    static long[] inputL(int n) 
    {
	    long A[]=new long[n];
	    for(int i=0;i<n;i++) 
		   A[i]=sc.nextLong();
	    return A;
    }
    
    
    
 
    
    // taking input in array of size n(String)
    static String[] inputS(int n) 
    {
	    String A[]=new String[n];
	    for(int i=0;i<n;i++)
		   A[i]=sc.next();
	   
	    return A;
    }
    
    //array elements to hashmap
    static HashMap<Integer,Integer> hash(int A[])
    {
	    HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
	    for(int i : A) 
	    {
		    if(map.containsKey(i)) 
			    map.put(i, map.get(i)+1);
		    else
			    map.put(i, 1);
	    }
	    return map;
  }
    
    
    // max(int)
    static int max(int A[]) 
    {
    	int max=Integer.MIN_VALUE;
    	for(int i=0;i<A.length;i++)
    		max=Math.max(max, A[i]);
    	return max;
    }
    
    // max(long)
    static long max(long A[]) 
    {
    	long max=Long.MIN_VALUE;
    	for(int i=0;i<A.length;i++)
    		max=Math.max(max, A[i]);
    	return max;
    }
    
    //min(long)
    static long min(long A[])
    {
    	long min=Long.MAX_VALUE;
    	for(int i=0;i<A.length;i++)
    		min=Math.min(min, A[i]);
    	return min;
    }
    
    // min(int)
    static int min(int A[])
    {
    	int min=Integer.MAX_VALUE;
    	for(int i=0;i<A.length;i++)
    		min=Math.min(min, A[i]);
    	return min;
    }
    
    // sum of (int) elements of an array
    static long sum(int A[]) 
    {
    	long sum=0;
    	for(int i : A) 
    		sum+=i;
    	return sum;
    }
    
    // sum of (long) elements of an array
    static long sum(long A[]) 
    {
    	long sum=0;
    	for(long i : A)
    		sum+=i;
    	return sum;
    }
    
    // copying array elements to another array
    static int[] copy(int A[]) 
    {
    	int B[]=new int[A.length];
    	for(int i=0;i<A.length;i++) 
    		B[i]=A[i];
    	return B;
    }
    
    // reverse an array(long)
    static void reverse(long A[]) 
    {
    	int n=A.length;
    	long B[]=new long[n];
    	for(int i=0;i<n;i++)
    		B[i]=A[n-i-1];
    	for(int i=0;i<n;i++)
    		A[i]=B[i];
    	
    }
    
    // reverse an array(int)
    static void reverse(int A[])
    {
    	int n=A.length;
    	int B[]=new int[n];
    	for(int i=0;i<n;i++) 
    		B[i]=A[n-i-1];
    	for(int i=0;i<n;i++)
    		A[i]=B[i];
    	
    }
    
    

    // prefix sum(long)
    static long [] prefix(long A[]) 
    {
    	long p[]=new long[A.length];
    	p[0]=A[0];
    	for(int i=1;i<A.length;i++)
    		p[i]=p[i-1]+A[i];
    	return p;
    }
    
    // prefix sum(int)
    static long [] prefix(int A[]) 
    {
    	long p[]=new long[A.length];
    	p[0]=A[0];
    	for(int i=1;i<A.length;i++)
    		p[i]=p[i-1]+A[i];
    	return p;
    }

    //suffix sum(long)
    static long [] suffix(long A[]) 
    {
    	long p[]=new long[A.length];
    	p[A.length-1]=A[A.length-1];
    	for(int i=A.length-2;i>=0;i--)
    		p[i]=p[i+1]+A[i];
    	return p;
    }

    //suffix sum(int)
    static long [] suffix(int A[]) 
    {
    	long p[]=new long[A.length];
    	p[A.length-1]=A[A.length-1];
    	for(int i=A.length-2;i>=0;i--)
    		p[i]=p[i+1]+A[i];
    	return p;
    }
    
    //checking if a number is a prime
    static boolean prime(int n) 
    { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        double sq=Math.sqrt(n);
  
        for (int i = 5; i <= sq; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
    
    //binary search
    public static int binarysearch(int[] nums,int k)
    {
        int low=0;
        int high=nums.length-1;
        while(low<=high)
        {
            int mid=low+(high-low)/2;
            if(k==nums[mid])
                return mid;
            else if(k>nums[mid])
                low=mid+1;
            else
                high=mid-1;
        }
        return -1;
    }
    
    public static int bs(int[] nums,int k)
    {
        int low=0;
        int high=nums.length-1;
        while(low<=high)
        {
            int mid=low+(high-low)/2;
            if(k==nums[mid])
                return mid;
            else if(k>nums[mid])
                low=mid+1;
            else
                high=mid-1;
        }
        return low;
    }

   



   
   
    
    
    
   
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(
                new InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() { return Integer.parseInt(next()); }
 
        long nextLong() { return Long.parseLong(next()); }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    
   
	public static void main (String[] args) throws java.lang.Exception
	{
	    int t=i();
	    int s=i();
	    int v=i();
	    int j=i();
	    
	    int e=i();
	    int f=i();
	    long max=0;
	    if(e>f)
	    {
	        if(j<t)
	        {
	            max=j*e;
	        }
	        else if(j>t)
	        {
	            max=t*e;
	            int min=Math.min(j-t,Math.min(s,v));
	            max+=min*f;
	        }
	    }
	    else
	    {
	        int mi=Math.min(j,Math.min(s,v));
	        max=mi*f;
	        if(mi!=j)
	        {
	            j=j-mi;
	            max+=Math.min(j,t)*e;
	        }
	    }
	    println(max);
	    
	    
	     
	    
	    
	    
	
	}
	

}

