#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int v, nxt;
} e[600010];
int tot;
int first[300010];
void build(int u, int v) {
  e[++tot] = (Edge){v, first[u]};
  first[u] = tot;
  return;
}
int n;
int f[300010][32];
int dep[300010];
int siz[300010];
void dfs(int k, int fa) {
  f[k][0] = fa;
  dep[k] = dep[fa] + 1;
  siz[k] = 1;
  for (int i = first[k]; i; i = e[i].nxt)
    if (e[i].v != fa) {
      dfs(e[i].v, k);
      siz[k] += siz[e[i].v];
    }
  return;
}
void init() {
  for (int i = 1; i <= 20; i++)
    for (int j = 1; j <= n; j++) f[j][i] = f[f[j][i - 1]][i - 1];
  return;
}
int jump(int x, int y) {
  int now = 0;
  while (y) {
    if (y & 1) x = f[x][now];
    y >>= 1;
    now++;
  }
  return x;
}
int getlca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  int need = dep[x] - dep[y];
  x = jump(x, need);
  if (x == y) return x;
  for (int i = 20; i >= 0; i--)
    if (f[x][i] != f[y][i]) x = f[x][i], y = f[y][i];
  return f[x][0];
}
int main() {
  int x, y;
  scanf("%d", &n);
  scanf("%d %d", &x, &y);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    build(u, v);
    build(v, u);
  }
  dfs(1, 0);
  init();
  int l = getlca(x, y);
  long long cannot = 0;
  if (l == x) {
    x = jump(y, dep[y] - dep[x] - 1);
    cannot = (long long)(n - siz[x]) * siz[y];
  } else if (l == y) {
    y = jump(x, dep[x] - dep[y] - 1);
    cannot = (long long)siz[x] * (n - siz[y]);
  } else
    cannot = (long long)siz[x] * siz[y];
  printf("%I64d\n", (long long)n * (n - 1) - cannot);
  return 0;
}
