#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const int kMaxn = 300010;
int n, x, y, a = 1, b = 1, size[kMaxn], hasy[kMaxn];
std::vector<int> g[kMaxn];
int dfs(int now, int fa) {
  if (now == y) hasy[now] = 1;
  size[now] = 1;
  for (int i : g[now])
    if (i != fa) {
      dfs(i, now);
      size[now] += hasy[i] ? 0 : size[i];
      hasy[now] |= hasy[i];
    }
  return size[now];
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  memset(hasy, 0, sizeof(hasy));
  dfs(x, -1);
  a = size[x];
  b = size[y];
  printf("%I64d\n", (long long)n * n - n - (long long)a * b);
  return 0;
}
