#include <bits/stdc++.h>
using namespace std;
int setBit(int n, int pos) { return n = n | (1 << pos); }
int resetBit(int n, int pos) { return n = n & ~(1 << pos); }
bool checkBit(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
const int MAX = 300010;
int sub[MAX];
int lg;
int L[MAX];
int P[MAX][20];
vector<int> ed[MAX];
void dfs(int s, int par, int l) {
  int i, x;
  L[s] = l;
  sub[s] = 1;
  for (i = 0; i < ed[s].size(); i++) {
    x = ed[s][i];
    if (x != par) {
      P[x][0] = s;
      dfs(x, s, l + 1);
      sub[s] += sub[x];
    }
  }
}
void lca_build(int n, int root) {
  memset(P, -1, sizeof(P));
  dfs(root, -1, 0);
  lg = (log(n) / log(2.0)) + 2;
  int i, j;
  for (j = 1; (1 << j) <= n; j++)
    for (i = 1; i <= n; i++)
      if (P[i][j - 1] != -1) P[i][j] = P[P[i][j - 1]][j - 1];
}
inline int lca_query(int x, int y) {
  if (L[x] < L[y]) swap(x, y);
  int i, j;
  for (i = lg; i >= 0; i--)
    if (L[x] - (1 << i) >= L[y]) x = P[x][i];
  if (x == y) return x;
  for (i = lg; i >= 0; i--) {
    if (P[x][i] != -1 && P[x][i] != P[y][i]) {
      x = P[x][i];
      y = P[y][i];
    }
  }
  return P[x][0];
}
int main() {
  int x, y, a, b;
  long long n;
  scanf("%lld", &n);
  scanf("%d %d", &x, &y);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &a, &b);
    ed[a].push_back(b);
    ed[b].push_back(a);
  }
  lca_build(n, y);
  long long ans = n * (n - 1);
  long long my;
  for (int i = 0; i < ed[y].size(); i++) {
    if (lca_query(ed[y][i], x) == ed[y][i]) {
      my = sub[y] - sub[ed[y][i]];
    }
  }
  long long p = sub[x];
  ans -= my * p;
  cout << ans << endl;
  return 0;
}
