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

public class Main {

  private int myN;
  private int myX;
  private int myY;

  public static void main(String[] args) throws FileNotFoundException {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
//    InputStream inputStream = new FileInputStream("input.txt");
//    OutputStream outputStream = new FileOutputStream("output.txt");
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    Main solver = new Main();
    solver.solve(1, in, out);
    out.close();
  }

  Map<Integer, List<Integer>> g = new HashMap<>();

  void solve(int testNumber, InputReader in, PrintWriter out) {
    myN = in.nextInt();
    myX = in.nextInt();
    myY = in.nextInt();
    for (int i = 0; i < myN - 1; i++) {
      int u = in.nextInt() - 1;
      int v = in.nextInt() - 1;
      g.putIfAbsent(u, new ArrayList<>());
      g.putIfAbsent(v, new ArrayList<>());
      g.get(u).add(v);
      g.get(v).add(u);
    }

    if (myX == myY) {
      out.println((long) (myN - 1) * myX);
      return;
    }

    if (myX < myY) {
      less(out);
    } else {
      greater(out);
    }


  }

  final int MAXN = 200_005;
  boolean used[] = new boolean[MAXN];
  boolean available[] = new boolean[MAXN];
  int took;

  private void less(PrintWriter out) {
    dfs(0);
    long ans = (long) took * myX + (long) (myN - took - 1) * myY;
    out.print(ans);
  }

  private void dfs(int u) {
    used[u] = true;
    if (!g.containsKey(u) || g.get(u).isEmpty()) {
      available[u] = true;
      return;
    }
    int take = 0;
    for (Integer to : g.get(u)) {
      if (!used[to]) {
        dfs(to);
      }
      if (available[to]) {
        take++;
      }
    }
    if (take == 0) {
      available[u] = true;
    } else if (take == 1) {
      available[u] = true;
      took++;
    } else {
      available[u] = false;
      took += 2;
    }
  }

  private void greater(PrintWriter out) {
    boolean bad = false;
    for (Map.Entry<Integer, List<Integer>> entry : g.entrySet()) {
      int size = entry.getValue().size();
      if (size == myN - 1) {
        bad = true;
      }
    }
    if (bad) {
      out.println((long) (myN - 2) * myY + myX);
    } else {
      out.println((long) myY * (myN - 1));
    }
  }





}


class InputReader {
  public BufferedReader reader;
  public StringTokenizer tokenizer;

  public InputReader(InputStream stream) {
    reader = new BufferedReader(new InputStreamReader(stream), 32768);
    tokenizer = null;
  }

  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  public double nextDouble() {
    return Double.parseDouble(next());
  }

  public int nextInt() {
    return Integer.parseInt(next());
  }

  public long nextLong() {
    return Long.parseLong(next());
  }

}