#include<iostream>
#include<utility>
#include<string>
#include<cstdio>
#include<cstring>
#include<stack>
#include<vector>
using namespace std;
template <class t1, class t2>
class Graph
{
public:
vector< pair<t1,t2> > node[200005];
int height[200005], path_length[200005];
bool visited[200005];
stack<int> stk;
void init()
{
memset(visited,false,200005);
while(!stk.empty())
stk.pop();
}
void add_edge(int u, int v, int w)
{
pair<t1,t2> p;
p = make_pair(v,w);
node[u].push_back(p);
}
void show_graph()
{
for(int i=0;i<10;i++)
{
int size = node[i].size();
cout<<i<<" -> ";
for(int j=0;j<size;j++)
cout<<"("<<node[i][j].first<<','<<node[i][j].second<<")"<<" -> ";
cout<<"x\n";
}
}
long long dfs(int v)
{
int size;
size = node[v].size();
if(size==0)
{
height[v] = 1;
path_length[v] = 1;
return height[v];
}
if(size == 1)
{
height[v] = 1 + dfs(node[v][1].first);
path_length[v] = height[v];
return height[v];
}
int temp = 0,temp1;
height[v] = -1;
int max1=1,max2=1;
for(int j=0;j<size;j++)
{
if(!visited[node[v][j].first])
{
visited[node[v][j].first] = true;
temp = dfs(node[v][j].first);
if(height[v]<temp)
height[v] = temp;
if(max1<temp)
{
temp1 = max1;
max1 = temp;
max2 = temp1;
}
}
}
path_length[v] = max1 + max2 + 1;
return height[v];
}
};
int main()
{
std::ios_base::sync_with_stdio(0);
cin.tie(0);
long long N,x,y,a,b;
cin>>N>>x>>y;
Graph<long long,long long> G;
G.init();
for(int i=0;i<N-1;i++)
{
cin>>a>>b;
G.add_edge(a,b,x);
G.add_edge(b,a,x);
}
if(x>=y)
{
bool flag = false;
for(int i=1;i<=N;i++)
{
if(G.node[i].size()==(unsigned)(N-1))
{
flag = true;
break;
}
}
if(flag)
cout<<(N-2)*y+x<<'\n';
else
cout<<(N-1)*y<<'\n';
}
else
{
G.dfs(1);
long long ans = -1;
for(int i=1;i<=N;i++)
{
if(ans<G.path_length[i])
ans = G.path_length[i];
}
ans--;
cout<<ans*x + (N-1-ans)*y<<'\n';
}
return 0;
}
I2luY2x1ZGU8a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