#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
vector<int> G[N];
int n, x, y;
long long sz[N];
long long ans;
int dfs(int fa, int u) {
  sz[u] = 1;
  int t = 0, p = 0;
  for (int v : G[u]) {
    if (v != fa) {
      t = dfs(u, v);
      if (t == 1) {
        p = v;
      }
      sz[u] += sz[v];
    }
  }
  if (u == x) {
    ans -= (sz[x] - sz[p]) * sz[y];
  }
  if (u == y) return 1;
  return p > 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x >> y;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  ans = 1LL * n * (n - 1);
  dfs(0, x);
  cout << ans << endl;
  return 0;
}
