#include <bits/stdc++.h>
using namespace std;
vector<int> lu[300010];
int m = 0, q = 0, x, y;
int pre[300010];
bool vis[300010];
bool vis1[300010];
void df(int a, int fa) {
  pre[a] = fa;
  if (a == y) return;
  for (int i = 0; i < lu[a].size(); i++) {
    if (lu[a][i] == fa) continue;
    df(lu[a][i], a);
  }
  return;
}
void dfs(int a, int pre) {
  m++;
  vis1[a] = true;
  for (int i = 0; i < lu[a].size(); i++) {
    if ((vis1[lu[a][i]]) || (vis[lu[a][i]])) continue;
    dfs(lu[a][i], a);
  }
  return;
}
void dfs1(int a, int pre) {
  vis1[a] = true;
  q++;
  for (int i = 0; i < lu[a].size(); i++) {
    if ((vis1[lu[a][i]]) || (vis[lu[a][i]])) continue;
    dfs1(lu[a][i], a);
  }
  return;
}
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &a, &b);
    lu[a].push_back(b);
    lu[b].push_back(a);
  }
  long long sum = (long long)n * (n - 1);
  df(x, -1);
  for (int i = pre[y]; i != x; i = pre[i]) {
    vis[i] = true;
  }
  vis[x] = vis[y] = true;
  dfs(y, -1);
  dfs1(x, -1);
  sum = sum - (long long)m * q;
  printf("%lld", sum);
  return 0;
}
