#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)3e5 + 5;
int sz[MAXN], dep[MAXN], fa[MAXN];
struct edge {
  int to, nxt;
} ed[MAXN << 1];
int head[MAXN], cnt;
void addedge(int u, int v) {
  ed[cnt].to = v;
  ed[cnt].nxt = head[u];
  head[u] = cnt++;
}
void dfs(int u, int pre) {
  fa[u] = pre;
  sz[u] = 1;
  for (int i = head[u]; i != -1; i = ed[i].nxt) {
    int v = ed[i].to;
    if (v == pre) continue;
    dep[v] = dep[u] + 1;
    dfs(v, u);
    sz[u] += sz[v];
  }
}
int main() {
  memset(head, -1, sizeof(head));
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addedge(u, v);
    addedge(v, u);
  }
  dep[1] = 1;
  dfs(1, 0);
  int xx, yy, lx, ly;
  xx = x, yy = y;
  while (dep[xx] != dep[yy]) {
    lx = xx;
    ly = yy;
    if (dep[xx] < dep[yy])
      yy = fa[yy];
    else
      xx = fa[xx];
  }
  long long ans = 1ll * n * (n - 1);
  if (xx != yy) {
    ans -= 1ll * sz[x] * sz[y];
  } else {
    int a, b;
    if (dep[x] > dep[y])
      a = sz[x], b = n - sz[lx];
    else
      a = n - sz[ly], b = sz[y];
    ans -= 1ll * a * b;
  }
  printf("%lld\n", ans);
  return 0;
}
