#include <bits/stdc++.h>
using namespace std;
vector<int> g[(int)3e5 + 7];
bool vis[(int)3e5 + 7];
int par[(int)3e5 + 7];
int sub[(int)3e5 + 7];
void dfs(int src, int d) {
  vis[src] = true;
  par[src] = d;
  sub[src] = 1;
  for (int i = 0; i < g[src].size(); i++) {
    int temp = g[src][i];
    if (vis[temp]) continue;
    dfs(temp, src);
    sub[src] += sub[temp];
  }
}
int f(int u, int v) {
  while (par[v] != u) {
    v = par[v];
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, y, x;
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(x, -1);
  int z = f(x, y);
  long long int ans = 1LL * n * (n - 1);
  long long int bad = 1LL * (sub[x] - sub[z]) * sub[y];
  cout << ans - bad << endl;
  return 0;
}
