#include <bits/stdc++.h>
using namespace std;
const long long INF = 1 << 31 - 1, MAX = 3e5 + 100;
long long a, b, x, y, n, k, m, cnt, ans, mmax, tmp, u, v, nxt;
bool used[MAX], use[MAX];
string s;
long long head[MAX], cntedge;
struct Edge {
  long long nxt, to;
} edge[MAX * 2];
void init() {
  for (long long i = 0; i < MAX; ++i) head[i] = -1;
  a = b = k = m = cnt = ans = mmax = tmp = u = v = nxt = cntedge = 0;
  memset(used, 0, sizeof(used));
  memset(use, 0, sizeof(use));
  return;
}
void addedge(long long u, long long v) {
  edge[cntedge].to = v;
  edge[cntedge].nxt = head[u];
  head[u] = cntedge++;
}
bool dfs1(long long now) {
  if (now == y) {
    use[now] = true;
    return true;
  }
  for (long long i = head[now]; i != -1; i = edge[i].nxt) {
    nxt = edge[i].to;
    if (!used[nxt]) {
      used[nxt] = 1;
      if (dfs1(nxt)) {
        return use[now] = true;
      }
    }
  }
  return false;
}
queue<long long> que;
long long dfs(long long st, long long ed) {
  long long ret = 0, now;
  while (que.size()) que.pop();
  que.push(st), use[st] = 1, ret++;
  while (que.size()) {
    now = que.front();
    que.pop();
    for (long long i = head[now]; i != -1; i = edge[i].nxt) {
      nxt = edge[i].to;
      if (nxt == ed) continue;
      if (!use[nxt]) {
        ++ret, use[nxt] = 1;
        que.push(nxt);
      }
    }
  }
  return ret;
}
signed main() {
  while (cin >> n >> x >> y) {
    init();
    for (long long i = 0; i < n - 1; ++i) {
      cin >> u >> v;
      addedge(u, v);
      addedge(v, u);
    }
    used[x] = 1, use[x] = 1;
    dfs1(x);
    use[x] = use[y] = 0;
    cout << n * (n - 1) - (dfs(x, y) * dfs(y, x)) << endl << endl;
  }
  return 0;
}
