int N, X, Y;
vi G[300005];
int dfs(int u, int p, int ng) {
if (u == ng)RT 0;
int re = 1;
each(v, G[u]) if(v!=p){
int a = dfs(v, u, ng);
if (a == 0 && u != (X^Y^ng)) {
RT 0;
}
re += a;
}
RT re;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(20);
cin >> N >> X >> Y;
--X; --Y;
rep(a, N - 1) {
int u, v;
cin >> u >> v;
--u; --v;
G[u].push_back(v);
G[v].push_back(u);
}
ll xx = dfs(X, -1, Y);
ll yy = dfs(Y, -1, X);
ll re = N*(N - 1ll) - xx*yy;
cout << re << endl;
}