#include <bits/stdc++.h>
using namespace std;
long long int n;
int x, y, p, q;
vector<int> v[300001];
bool vis[300001];
bool visp[300001];
bool contains_f(int u) {
  if (u == x) return true;
  visp[u] = true;
  for (int i = 0; i < v[u].size(); i++) {
    int nd = v[u][i];
    if (!visp[nd] && contains_f(nd)) {
      return true;
    }
  }
  return false;
}
bool contains_b(int u) {
  if (u == y) return true;
  visp[u] = true;
  for (int i = 0; i < v[u].size(); i++) {
    int nd = v[u][i];
    if (!visp[nd] && contains_b(nd)) {
      return true;
    }
  }
  return false;
}
long long int get_size(int u) {
  int cnt = 0;
  vis[u] = true;
  for (int i = 0; i < v[u].size(); i++) {
    if (!vis[v[u][i]]) cnt += get_size(v[u][i]);
  }
  return 1 + cnt;
}
int main() {
  cin >> n >> x >> y;
  x--;
  y--;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &p, &q);
    p--;
    q--;
    v[p].push_back(q);
    v[q].push_back(p);
  }
  long long int fsize = 0;
  long long int bsize = 0;
  visp[x] = true;
  vis[x] = true;
  for (int i = 0; i < v[x].size(); i++) {
    if (!contains_b(v[x][i])) fsize += get_size(v[x][i]);
  }
  for (int i = 0; i < n; i++) {
    vis[i] = false;
    visp[i] = false;
  }
  visp[y] = true;
  vis[y] = true;
  for (int i = 0; i < v[y].size(); i++) {
    if (!contains_f(v[y][i])) bsize += get_size(v[y][i]);
  }
  fsize++;
  bsize++;
  cout << (n - 1) * n - fsize * bsize << "\n";
  return 0;
}
