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>.
#include <bits/stdc++.h>
using namespace std;
const int N = 200001;
long long n, x, y;
vector<int> gr[N];
long long solve_case1() {
  bool isStarGraph = false;
  for (int i = 1; i <= n; i++) {
    isStarGraph |= (gr[i].size() == n - 1);
  }
  if (isStarGraph) return (n - 2) * y + x;
  return (n - 1) * y;
}
long long dp[N][2];
long long solve_case2(int v, int pV, bool pegueiumaaresta) {
  long long &res = dp[v][pegueiumaaresta];
  if (res) return res;
  long long dpDanft[3];
  memset(dpDanft, 0, sizeof dpDanft);
  for (int i = 0; i < gr[v].size(); i++) {
    int u = gr[v][i];
    if (u == pV) continue;
    solve_case2(u, v, true);
    solve_case2(u, v, false);
    dpDanft[2] = max(dpDanft[2] + dp[u][0], dpDanft[1] + dp[u][1] + 1);
    dpDanft[1] = max(dpDanft[1] + dp[u][0], dpDanft[0] + dp[u][1] + 1);
    dpDanft[0] += dp[u][0];
  }
  if (pegueiumaaresta) return res = max(dpDanft[1], dpDanft[0]);
  return res = max(dpDanft[0], max(dpDanft[1], dpDanft[2]));
}
int main(void) {
  cin >> n >> x >> y;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  if (x >= y) {
    cout << solve_case1() << endl;
  } else {
    long long spanning = solve_case2(1, 0, false);
    cout << (spanning * x) + ((n - 1 - spanning) * y) << endl;
  }
  return 0;
}
