#include <bits/stdc++.h>
using namespace std;
vector<int> tree[300005];
bool done[300005];
int child[300005];
int dfs(int x) {
  done[x] = true;
  for (auto u : tree[x]) {
    if (done[u]) continue;
    child[x] += dfs(u);
  }
  child[x]++;
  return child[x];
}
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &a, &b);
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  memset(done, 0, sizeof done);
  memset(child, 0, sizeof child);
  dfs(x);
  long long chldy = child[y];
  memset(done, 0, sizeof done);
  memset(child, 0, sizeof child);
  dfs(y);
  long long chldx = child[x];
  cout << n * (n - 1LL) - chldx * chldy << endl;
}
