#include <bits/stdc++.h>
using namespace std;
int size[400005], n, x, y, head[400005], to[700005], nxt[700005], num;
void add(int u, int v) {
  nxt[++num] = head[u];
  head[u] = num;
  to[num] = v;
}
void dfs(int now, int fa) {
  size[now] = 1;
  for (int i = head[now]; i; i = nxt[i])
    if (to[i] != fa) {
      dfs(to[i], now);
      size[now] += size[to[i]];
    }
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  int u, v;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs(x, 0);
  long long f1 = size[y];
  memset(size, 0, sizeof size);
  dfs(y, 0);
  long long f2 = size[x];
  cout << (long long)n * (n - 1) - f1 * f2;
  return 0;
}
