#include <bits/stdc++.h>
using namespace std;
vector<long long int> arbre[300300];
long long int vu[300300] = {0};
long long int nf[300300] = {0};
long long int compter(int s) {
  vu[s] = 1;
  long long int t = 1;
  for (int i = 0; i < arbre[s].size(); i++) {
    if (vu[arbre[s][i]] == 0) {
      t += compter(arbre[s][i]);
    }
  }
  nf[s] = t;
  return t;
}
void refaire(int s, int y) {
  if (s == y) {
    return;
  }
  vu[s] = 1;
  for (int i = 0; i < arbre[s].size(); i++) {
    if (vu[arbre[s][i]] == 0) {
      refaire(arbre[s][i], y);
    }
  }
}
int cherchery(int s, int y, int x) {
  if (s == x) {
    return 0;
  }
  vu[s] = 1;
  if (s == y) {
    return 1;
  }
  long long int t = 0;
  for (int i = 0; i < arbre[s].size(); i++) {
    if (vu[arbre[s][i]] == 0) {
      t += cherchery(arbre[s][i], y, x);
    }
  }
  return t;
}
int chercherx(int s, int y, int x) {
  if (s == x) {
    return 0;
  }
  vu[s] = 1;
  if (s == y) {
    return 1;
  }
  long long int t = 0;
  for (int i = 0; i < arbre[s].size(); i++) {
    if (vu[arbre[s][i]] == 0) {
      t += chercherx(arbre[s][i], y, x);
    }
  }
  return t;
}
int main() {
  long long int n, x, y, u, v;
  scanf("%lld %lld %lld", &n, &x, &y);
  x--;
  y--;
  for (int i = 0; i < n - 1; i++) {
    scanf("%lld %lld", &u, &v);
    u--;
    v--;
    arbre[u].push_back(v);
    arbre[v].push_back(u);
  }
  u = compter(0);
  for (int i = 0; i < n; i++) {
    vu[i] = 0;
  }
  refaire(0, x);
  int r1, r2, t1 = 0, t2 = 0, ok1 = 0, ok2 = 0;
  for (int i = 0; i < arbre[x].size(); i++) {
    if (vu[arbre[x][i]] == 1) {
      continue;
    }
    r1 = cherchery(arbre[x][i], y, x);
    if (r1 == 1) {
      ok1 = 1;
      t1 = nf[arbre[x][i]];
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    vu[i] = 0;
  }
  refaire(0, y);
  for (int i = 0; i < arbre[y].size(); i++) {
    if (vu[arbre[y][i]] == 1) {
      continue;
    }
    r2 = cherchery(arbre[y][i], x, y);
    if (r2 == 1) {
      ok2 = 1;
      t2 = nf[arbre[y][i]];
      break;
    }
  }
  if (ok1 == 0 && ok2 == 0) {
    printf("%lld\n", n * (n - 1) - nf[x] * nf[y]);
  } else if (ok1 == 1) {
    printf("%lld\n", n * (n - 1) - (n - t1) * nf[y]);
  } else if (ok2 == 1) {
    printf("%lld\n", n * (n - 1) - (n - t2) * nf[x]);
  }
  return 0;
}
