#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
vector<int> g[N];
int num[N];
int par[N];
int n, x, y;
int dfs(int u, int fa) {
  par[u] = fa;
  int cnt = 0;
  for (int v : g[u]) {
    if (v != fa) {
      cnt += dfs(v, u);
    }
  }
  return num[u] = cnt + 1;
}
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);
  }
  dfs(x, -1);
  long long ans = 0;
  int m = y;
  while (par[m] != x) {
    m = par[m];
  }
  ans = (long long)n * (n - 1);
  ans -= (long long)num[y] * (1LL * (n - num[m]));
  printf("%lld\n", ans);
  return 0;
}
