#include <bits/stdc++.h>
using namespace std;
const int maxn = 300300;
const int maxm = 600100;
int head[maxn], cnt;
void init() {
  memset(head, -1, sizeof head);
  cnt = 0;
}
struct edge {
  int to, next;
} E[maxm];
void add(int u, int v) {
  E[cnt].to = v;
  E[cnt].next = head[u];
  head[u] = cnt++;
}
int sz[maxn], dep[maxn], pn[maxn];
void dfs(int u, int p) {
  pn[u] = p;
  dep[u] = dep[p] + 1;
  sz[u] = 1;
  for (int i = head[u]; ~i; i = E[i].next) {
    int v = E[i].to;
    if (v == p) continue;
    dfs(v, u);
    sz[u] += sz[v];
  }
}
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  init();
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dep[0] = -1;
  dfs(x, 0);
  long long ans = (long long)(n - 1) * n;
  long long n1 = sz[y], n2 = 1;
  int v;
  for (v = y; pn[v] != x; v = pn[v])
    ;
  for (int i = head[x]; ~i; i = E[i].next) {
    int u = E[i].to;
    if (u == v) continue;
    n2 += sz[u];
  }
  ans -= (n1 * n2);
  printf("%I64d\n", ans);
  return 0;
}
