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.
import java.io.*;
import java.math.*;
import java.util.*;

public class test {

	public static void main(String[] args) {
//		int test = fs.nextInt();
		int test = 1;
		for (int cases = 0; cases < test; cases++) {
			int a = fs.nextInt();
			int b = fs.nextInt();
			int c = fs.nextInt();
			int d = fs.nextInt();
			int p1 = fs.nextInt();
			int p2 = fs.nextInt();
			long ans = 0;
			if (d < a && d < b && d < c) {
				if (p1 > p2) {
					ans = p1 * d;
				} else {
					ans = p2 * d;
				}
			} else {
				if (p1 > p2) {
					ans += (a * p1);
					d -= a;
					if (d > 0) {
						int k = Integer.min(b, c);
						if (d < k) {
							ans += (d * p2);
						} else {
							ans += (Integer.min(b, c) * p2);
						}
					}
				} else {
					int k = Integer.min(b, c);
					if (d < k) {
						ans += (d * p2);
					} else {
						ans += (k * p2);
						d -= k;
						if (d > 0) {
							if (d > a) {
								ans += (a * p1);
							} else {
								ans += (d * p1);
							}
						}
					}
				}
			}
			System.out.println(ans);
		}
	}

	/*
	 * array list
	 * 
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 * 
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 * 
	 * hash map
	 * 
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 * 
	 * while loop
	 * 
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 * 
	 * array input
	 * 
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */
	static class Graph {
		HashMap<Character, LinkedList<Character>> hm = new HashMap<Character, LinkedList<Character>>();

		private void addVertex(char vertex) {
			hm.put(vertex, new LinkedList<>());
		}

		private void addEdge(char source, char dest, boolean bi) {
			if (!hm.containsKey(source))
				addVertex(source);
			if (!hm.containsKey(dest))
				addVertex(dest);
			hm.get(source).add(dest);
			if (bi) {
				hm.get(dest).add(source);
			}
		}

		private boolean isCyclicUtil(char ch, boolean visited[], char parent, HashMap<Character, Integer> index) {
			visited[index.get(ch)] = true;
			Iterator<Character> it = hm.get(ch).iterator();
			while (it.hasNext()) {
				Character character = (Character) it.next();
				if (!visited[index.get(character)]) {
					if (isCyclicUtil(character, visited, ch, index))
						return true;
				} else if (character != ch)
					return true;
			}
			return false;
		}

		private boolean isCyclic(HashMap<Character, Integer> index) {
			boolean visited[] = new boolean[hm.size()];
			Set<Character> set = hm.keySet();
			for (Character character : set) {
				if (!visited[index.get(character)]) {
					if (isCyclicUtil(character, visited, '-', index))
						return true;
				}
			}
			return false;
		}
	}

	static class Node {
		Node left, right;
		int data;

		public Node(int data) {
			this.data = data;
		}

		public void insert(int val) {
			if (val <= data) {
				if (left == null) {
					left = new Node(val);
				} else {
					left.insert(val);
				}
			} else {
				if (right == null) {
					right = new Node(val);
				} else {
					right.insert(val);
				}
			}
		}

		public boolean contains(int val) {
			if (data == val) {
				return true;
			} else if (val < data) {
				if (left == null) {
					return false;
				} else {
					return left.contains(val);
				}
			} else {
				if (right == null) {
					return false;
				} else {
					return right.contains(val);
				}
			}
		}

		public void inorder() {
			if (left != null) {
				left.inorder();
			}
			System.out.print(data + " ");
			if (right != null) {
				right.inorder();
			}
		}

		public int maxDepth() {
			if (left == null)
				return 0;
			if (right == null)
				return 0;
			else {
				int ll = left.maxDepth();
				int rr = right.maxDepth();
				if (ll > rr)
					return (ll + 1);
				else
					return (rr + 1);
			}
		}

		public int countNodes() {
			if (left == null)
				return 1;
			if (right == null)
				return 1;
			else {
				return left.countNodes() + right.countNodes() + 1;
			}
		}

		public void preorder() {
			System.out.print(data + " ");
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}

		}

		public void postorder() {
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}
			System.out.print(data + " ");

		}

		public void levelorder(Node node) {
			LinkedList<Node> ll = new LinkedList<Node>();
			ll.add(node);
			getorder(ll);

		}

		public void getorder(LinkedList<Node> ll) {
			while (!ll.isEmpty()) {
				Node node = ll.poll();
				System.out.print(node.data + " ");
				if (node.left != null)
					ll.add(node.left);
				if (node.right != null)
					ll.add(node.right);
			}
		}
	}

	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;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	static int[] getintarray(int n) {
		int ar[] = new int[n];
		for (int i = 0; i < n; i++) {
			ar[i] = fs.nextInt();
		}
		return ar;
	}

	static long[] getlongarray(int n) {
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = fs.nextLong();
		}
		return ar;
	}

	static int[][] get2darray(int n, int m) {
		int ar[][] = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ar[i][j] = fs.nextInt();
			}
		}
		return ar;
	}

	static Pair[] getpairarray(int n) {
		Pair ar[] = new Pair[n];
		for (int i = 0; i < n; i++) {
			ar[i] = new Pair(fs.nextInt(), fs.nextInt());
		}
		return ar;
	}

	static void printarray(int ar[]) {
		for (int i : ar) {
			op.print(i + " ");
		}
		op.flush();
	}

	static int fact(int n) {
		int fact = 1;
		for (int i = 2; i <= n; i++) {
			fact *= i;
		}
		return fact;
	}

//	

	// function to find largest prime factor

}/*
	 * 1 5 -2 -3 -1 -4 -6till here
	 */

//		while (t > 0) {
//			int a[] = getintarray(3);
//			int b[] = getintarray(3);
//			int ans = getans(a, b);
//			System.out.println(ans);
//		}