#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 3;
int n, x, y;
int s[N];
int w[N];
int vis[N];
int flag = 0;
int anx = 0, any = 0;
int head[N];
struct node {
  int t;
  int net;
} e[2 * N];
int tot = 1;
void add(int a, int b) {
  e[tot].t = b;
  e[tot].net = head[a];
  head[a] = tot++;
}
void dfs1(int m, int step) {
  if (flag == 1) return;
  if (m == y) {
    flag = 1;
    for (int i = 0; i < step; i++) {
      w[s[i]] = 1;
    }
    return;
  }
  if (step >= n) return;
  for (int i = head[m]; i; i = e[i].net) {
    if (!vis[e[i].t]) {
      vis[e[i].t] = 1;
      s[step] = e[i].t;
      dfs1(e[i].t, step + 1);
      s[step] = 0;
      vis[e[i].t] = 0;
    }
  }
  return;
}
void dfs2(int m, int v) {
  for (int i = head[m]; i; i = e[i].net) {
    if (!w[e[i].t] && !vis[e[i].t]) {
      if (v == 0)
        anx++;
      else
        any++;
      vis[e[i].t] = 1;
      dfs2(e[i].t, v);
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  int a, b;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  vis[x] = 1;
  dfs1(x, 0);
  w[x] = 1;
  w[y] = 1;
  memset(vis, 0, sizeof(vis));
  vis[x] = 1;
  vis[y] = 1;
  dfs2(x, 0);
  dfs2(y, 1);
  long long d = (long long)n * (long long)(n - 1) -
                (long long)(anx + 1) * (long long)(any + 1);
  printf("%lld\n", d);
  return 0;
}
