#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > A(300005);
vector<int> par(300005, 0);
vector<int> visited(300005, 0);
vector<int> coun(300005, 0);
int x, y;
int fun(int i, int parent) {
  visited[i] = 1;
  par[i] = parent;
  int n = A[i].size();
  int z = 0;
  for (int j = 0; j < n; j++)
    if (!visited[A[i][j]]) {
      z += fun(A[i][j], i);
    }
  coun[i] = z + 1;
  return coun[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  cin >> x >> y;
  x--;
  y--;
  int a, b;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    A[a - 1].push_back(b - 1);
    A[b - 1].push_back(a - 1);
  }
  int i;
  long long int t;
  coun[x] = fun(x, x);
  i = y;
  t = 0;
  int last = 0;
  while (par[i] != i) {
    last = (coun[par[i]] - coun[i]);
    t += last;
    i = par[i];
  }
  t -= last;
  long long int ansa, ansb;
  ansa = coun[y];
  ansb = n - t - coun[y];
  ansa = ansb * ansa;
  long long int ans = n;
  ansb = ans * (ans - 1);
  cout << ansb - ansa;
  return 0;
}
