#include <bits/stdc++.h>
using namespace std;
long long n, f, b;
vector<int> lst[300002];
queue<int> Q;
bool visit[300002];
int deg[300002];
int p[300002];
long long res, y, x;
void bfs(int st) {
  int v;
  memset(visit, false, sizeof(visit));
  Q.push(st);
  visit[st] = true;
  while (!Q.empty()) {
    x++;
    v = Q.front();
    Q.pop();
    for (int i = 0; i < lst[v].size(); i++) {
      if (!visit[lst[v][i]] && deg[lst[v][i]] > deg[v]) {
        visit[lst[v][i]] = true;
        Q.push(lst[v][i]);
      }
    }
  }
}
int main() {
  int a1, b1, v;
  scanf("%I64d %I64d %I64d", &n, &f, &b);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &a1, &b1);
    lst[a1].push_back(b1);
    lst[b1].push_back(a1);
  }
  res = n * (n - 1);
  Q.push(b);
  visit[b] = true;
  while (!Q.empty()) {
    v = Q.front();
    Q.pop();
    for (int i = 0; i < lst[v].size(); i++) {
      if (!visit[lst[v][i]]) {
        visit[lst[v][i]] = true;
        deg[lst[v][i]] = deg[v] + 1;
        Q.push(lst[v][i]);
        p[lst[v][i]] = v;
      }
    }
  }
  v = f;
  while (p[p[v]] != 0) v = p[v];
  bfs(v);
  y = x;
  x = 0;
  bfs(f);
  res -= (n - y) * x;
  if (n != 1) printf("%I64d", res);
  if (n == 1) printf("0");
  return 0;
}
