#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> E;
vector<bool> M;
int dfs(int p, int q, int x) {
  M[p] = true;
  if (p == q) x = 1;
  int y = x;
  for (auto a : E[p])
    if (!M[a]) y += dfs(a, q, x);
  return y;
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, x, y;
  cin >> n >> x >> y;
  x--;
  y--;
  E.resize(n);
  M.resize(n);
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    E[a - 1].push_back(b - 1);
    E[b - 1].push_back(a - 1);
  }
  fill(M.begin(), M.end(), 0);
  int64_t X = dfs(x, y, 0);
  fill(M.begin(), M.end(), 0);
  int64_t Y = dfs(y, x, 0);
  int64_t N = n;
  cout << N * (N - 1LL) - X * Y << endl;
  return 0;
}
