#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 300005;
const int maxm = 300005 * 2;
int n, x, y;
struct node {
  int to, next;
} g[maxm];
int head[maxn], tol;
long long sizes[maxn];
long long cnt[2], ans;
int vis[maxn];
void addedge(int u, int v) {
  g[tol].to = v;
  g[tol].next = head[u];
  head[u] = tol++;
}
void dfs(int x) {
  int flag = 0;
  for (int i = head[x]; i != -1; i = g[i].next) {
    int to = g[i].to;
    if (!vis[to]) {
      vis[to] = 1;
      dfs(to);
      sizes[x] += sizes[to];
      flag = 1;
    }
  }
  if (flag == 0)
    sizes[x] = 1;
  else
    sizes[x]++;
}
int main() {
  memset(head, -1, sizeof(head));
  tol = 0;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addedge(u, v);
    addedge(v, u);
  }
  long long sum1 = 0, sum2 = 0;
  vis[x] = 1;
  dfs(x);
  sum1 = sizes[y];
  memset(sizes, 0, sizeof(sizes));
  memset(vis, 0, sizeof(vis));
  vis[y] = 1;
  dfs(y);
  sum2 = sizes[x];
  long long ans = (long long)n * (n - 1);
  ans -= sum1 * sum2;
  printf("%lld\n", ans);
  return 0;
}
