A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are <image> roads in total. It takes exactly y seconds to traverse any single road.

A spanning tree is a set of roads containing exactly n - 1 roads such that it's possible to travel between any two cities using only these roads.

Some spanning tree of the initial network was chosen. For every road in this tree the time one needs to traverse this road was changed from y to x seconds. Note that it's not guaranteed that x is smaller than y.

You would like to travel through all the cities using the shortest path possible. Given n, x, y and a description of the spanning tree that was chosen, find the cost of the shortest path that starts in any city, ends in any city and visits all cities exactly once.

Input

The first line of the input contains three integers n, x and y (2 ≤ n ≤ 200 000, 1 ≤ x, y ≤ 109).

Each of the next n - 1 lines contains a description of a road in the spanning tree. The i-th of these lines contains two integers ui and vi (1 ≤ ui, vi ≤ n) — indices of the cities connected by the i-th road. It is guaranteed that these roads form a spanning tree.

Output

Print a single integer — the minimum number of seconds one needs to spend in order to visit all the cities exactly once.

Examples

Input

5 2 3
1 2
1 3
3 4
5 3


Output

9


Input

5 3 2
1 2
1 3
3 4
5 3


Output

8

Note

In the first sample, roads of the spanning tree have cost 2, while other roads have cost 3. One example of an optimal path is <image>.

In the second sample, we have the same spanning tree, but roads in the spanning tree cost 3, while other roads cost 2. One example of an optimal path is <image>.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Iterator;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Arthur Petukhovsky petuhovskiy@yandex.ru
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        ListInt[] graph;

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int x = in.nextInt();
            int y = in.nextInt();
            graph = new ListInt[n];
            for (int i = 0; i < n; i++) graph[i] = new ListInt();
            for (int i = 0; i < n - 1; i++) {
                int f = in.nextInt() - 1;
                int s = in.nextInt() - 1;
                graph[f].push(s);
                graph[s].push(f);
            }
            boolean hasStar = false;
            for (int i = 0; i < n; i++) {
                if (graph[i].size() == n - 1) hasStar = true;
            }
            if (n == 2) {
                out.println(x);
                return;
            }
            if (hasStar) {
                if (y < x) {
                    out.println((long) y * (n - 2) + x);
                } else {
                    out.println((long) x * 2 + (long) (n - 3) * y);
                }
                return;
            }
            if (y < x) {
                out.println((long) (n - 1) * y);
                return;
            }
            PairInt result = dfs(0, -1);
            int all = n - 1;
            int jumpY = result.first - 1;
            int jumpX = all - jumpY;
            out.println((long) jumpY * y + (long) jumpX * x);
        }

        PairInt dfs(int x, int pr) {
            List<PairInt> list = new ArrayList<>();
            for (int to : graph[x]) {
                if (to != pr) list.add(dfs(to, x));
            }
            if (list.isEmpty()) return new PairInt(1, 1);
            if (list.size() == 1) {
                PairInt child = list.get(0);
                int cost = Math.min(child.first + 1, child.second);
                return new PairInt(cost, cost);
            }
            int first = list.get(0).second - list.get(0).first;
            int second = list.get(1).second - list.get(1).first;
            int sum = list.get(0).first + list.get(1).first;
            for (int i = 2; i < list.size(); i++) {
                sum += list.get(i).first;
                if (first > second) {
                    int d = first;
                    first = second;
                    second = d;
                }
                int value = list.get(i).second - list.get(i).first;
                if (value < second) {
                    second = value;
                }
            }
            int finished = sum + first + second - 1;
            int unfinished = sum + Math.min(first, second);
            finished = Math.min(finished, sum + 1);
            unfinished = Math.min(unfinished, sum + 1);
            return new PairInt(finished, unfinished);
        }

    }

    static class ListInt implements Iterable<Integer> {
        private int capacity = 2;
        private int[] data = new int[capacity];
        private int size = 0;

        public ListInt() {
        }

        public ListInt(int n) {
            super();
            resize(n);
        }

        public void push(int x) {
            if (size == capacity) grow();
            data[size++] = x;
        }

        private void grow() {
            if (capacity < 2) {
                capacity++;
            } else {
                capacity = size + (size >> 1);
            }
            data = Arrays.copyOf(data, capacity);
        }

        private void grow(int newSize) {
            capacity = newSize;
            data = Arrays.copyOf(data, capacity);
        }

        public void resize(int newSize) {
            if (newSize > capacity) {
                grow(newSize);
            }
            size = newSize;
        }

        public int size() {
            return size;
        }


        public Iterator<Integer> iterator() {
            return new Iterator<Integer>() {

                int position = 0;


                public boolean hasNext() {
                    return position < size;
                }


                public Integer next() {
                    return data[position++];
                }
            };
        }

    }

    static class FastScanner {
        final static int BUFFER_SIZE = 65536;
        BufferedReader br;
        char[] buf = new char[BUFFER_SIZE];
        int len = 0;
        int it = 0;
        boolean end = false;

        boolean delim(char c) {
            return c == ' ' || c == '\n' || c == '\r';
        }

        void fillBuffer() {
            try {
                len = br.read(buf);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        void ensureBuffer() {
            if (it == len) {
                it = 0;
                fillBuffer();
                if (len == -1) end = true;
            }
        }

        void moveNext() {
            while (!end) {
                ensureBuffer();
                if (!delim(buf[it])) return;
                while (it < len && delim(buf[it])) it++;
            }
        }

        public int nextInt() {
            moveNext();
            if (buf[it] == '-') {
                it++;
                return -nextInt();
            }
            if (buf[it] == '+') {
                it++;
                return nextInt();
            }
            int result = 0;
            while (!end) {
                int l = it;
                while (it < len && !delim(buf[it])) {
                    result = (result * 10) + buf[it] - '0';
                    it++;
                }
                ensureBuffer();
                if (end || delim(buf[it])) break;
            }
            return result;
        }

        public FastScanner(String file) {
            try {
                br = new BufferedReader(new FileReader(file), BUFFER_SIZE);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is), BUFFER_SIZE);
        }

    }

    static class PairInt implements Comparable<PairInt> {
        public int first;
        public int second;

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


        public int compareTo(PairInt pairInt) {
            if (first > pairInt.first) return 1;
            if (first < pairInt.first) return -1;
            if (second > pairInt.second) return 1;
            return second == pairInt.second ? 0 : -1;
        }


        public String toString() {
            return "(" + first + "; " + second + ")";
        }

    }
}

