#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 10;
long long vis[maxn];
struct edge {
  long long u, v;
} e[2 * maxn];
vector<long long> v[maxn];
long long n, x, y, num = 0, cntx = 0, cnty = 0;
inline void conect(long long a, long long b) {
  e[num].u = a;
  e[num].v = b;
  v[a].push_back(num++);
}
bool dfs1(long long k, long long last) {
  if (k == y) {
    vis[k] = 1;
    cntx++;
    return true;
  }
  vector<long long>::iterator p = v[k].begin();
  while (p != v[k].end()) {
    edge &te = e[*p];
    if (te.v == last) {
      p++;
      continue;
    }
    if (dfs1(te.v, te.u)) {
      vis[te.u] = 1;
      cntx++;
      return true;
    }
    p++;
  }
  return false;
}
void dfs2(long long k, long long last) {
  cnty++;
  vector<long long>::iterator p = v[k].begin();
  while (p != v[k].end()) {
    edge &te = e[*p];
    if (te.v == last || vis[te.v]) {
      p++;
      continue;
    }
    dfs2(te.v, te.u);
    p++;
  }
}
int main() {
  cin >> n >> x >> y;
  long long ans = n * (n - 1), i, j, k;
  memset(vis, 0, sizeof(vis));
  for (i = 0; i < n - 1; i++) {
    scanf("%lld%lld", &j, &k);
    conect(j, k);
    conect(k, j);
  }
  dfs1(x, -1);
  dfs2(y, -1);
  cntx = cnty;
  cnty = 0;
  dfs2(x, -1);
  cout << ans - cntx * cnty << endl;
  return 0;
}
