#include <bits/stdc++.h>
using namespace std;
long long n, x, y, ans;
struct Edge {
  long long to, next;
} edge[2 * 300001];
long long head[300001], sze;
long long fa[300001], Tsze[300001], deep[300001];
inline char gc() {
  static char now[1 << 20], *S, *T;
  if (T == S) {
    T = (S = now) + fread(now, 1, 1 << 20, stdin);
    if (T == S) return EOF;
  }
  return *S++;
}
inline long long read() {
  long long res = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  res = (c ^ 48);
  while ((c = getchar()) >= '0' && c <= '9')
    res = (res << 3) + (res << 1) + (c ^ 48);
  return res;
}
inline void add(long long u, long long v) {
  edge[++sze] = (Edge){v, head[u]}, head[u] = sze;
  edge[++sze] = (Edge){u, head[v]}, head[v] = sze;
}
inline void dfs(long long u, long long f) {
  fa[u] = f, deep[u] = deep[f] + 1, Tsze[u] = 1;
  long long i;
  for (i = head[u]; i; i = edge[i].next) {
    long long v = edge[i].to;
    if (v == f) continue;
    dfs(v, u), Tsze[u] += Tsze[v];
  }
}
inline long long ask() {
  if (deep[x] > deep[y]) swap(x, y);
  long long ok = 0, i;
  for (i = y; i; i = fa[i])
    if (i == x) {
      ok = 1;
      break;
    }
  if (ok) return (n - Tsze[x] + 1) * Tsze[y];
  return Tsze[x] * Tsze[y];
}
signed main() {
  n = read(), x = read(), y = read(), ans = n * (n - 1);
  long long i;
  for (i = 1; i < n; i++) add(read(), read());
  dfs(1, 0);
  long long a = x, b = y, ok = 0;
  for (; a; a = fa[a])
    if (fa[a] == y) ans -= Tsze[x] * (n - Tsze[a]), ok = 1;
  for (; b; b = fa[b])
    if (fa[b] == x) ans -= Tsze[y] * (n - Tsze[b]), ok = 1;
  if (!ok) ans -= Tsze[x] * Tsze[y];
  printf("%lld", ans);
  return 0;
}
