#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v, i, next;
} edge[610000];
struct node {
  int u, v;
} s[310000];
int head[310000], tot, used[310000], ph[310000], flag;
int f[310000], r[310000];
void add(int u, int v, int i) {
  edge[tot].v = v;
  edge[tot].i = i;
  edge[tot].next = head[u];
  head[u] = tot++;
}
void init(int n) {
  tot = 0;
  memset(head, -1, sizeof(head));
  memset(used, 0, sizeof(used));
  memset(ph, 0, sizeof(ph));
  for (int i = 1; i <= n; i++) {
    f[i] = i;
    r[i] = 1;
  }
  flag = false;
}
void dfs(int u, int t) {
  if (u == t) {
    flag = true;
    return;
  }
  used[u] = 1;
  for (int i = head[u]; i != -1; i = edge[i].next) {
    int v = edge[i].v;
    if (used[v]) continue;
    dfs(v, t);
    if (flag) {
      ph[edge[i].i] = 1;
      return;
    }
  }
  used[u] = 0;
  return;
}
int finde(int x) {
  if (f[x] != x) return f[x] = finde(f[x]);
  return x;
}
int main() {
  int n, x, y;
  scanf("%d %d %d", &n, &x, &y);
  init(n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &s[i].u, &s[i].v);
    add(s[i].u, s[i].v, i);
    add(s[i].v, s[i].u, i);
  }
  dfs(x, y);
  for (int i = 1; i < n; i++) {
    if (ph[i]) continue;
    int fx = finde(s[i].u);
    int fy = finde(s[i].v);
    if (fx != fy) {
      f[fx] = fy;
      r[fy] += r[fx];
    }
  }
  long long ans = (long long)n * (long long)(n - 1);
  int fx = finde(x);
  int fy = finde(y);
  ans = ans - (long long)r[fx] * (long long)r[fy];
  cout << ans << endl;
  return 0;
}
