#include <bits/stdc++.h>
using namespace std;
long long int n, x, y, d[300001];
vector<long long int> v[300005];
bool check[300001], vizitat[300001];
long long int DFS(int nod) {
  d[nod] = 1;
  vizitat[nod] = 1;
  if (nod == x)
    check[nod] = true;
  else
    check[nod] = false;
  for (int i = 0; i < v[nod].size(); i++) {
    int nod_urm = v[nod][i];
    if (!vizitat[nod_urm]) {
      d[nod] += DFS(nod_urm);
      check[nod] |= check[nod_urm];
    }
  }
  return d[nod];
}
int main() {
  cin >> n >> x >> y;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  DFS(y);
  long long int k;
  for (int i = 0; i < v[y].size(); i++) {
    if (check[v[y][i]]) {
      k = d[y] - d[v[y][i]];
      break;
    }
  }
  cout << n * (n - 1) - k * d[x];
  return 0;
}
