#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int maxm = 6e5 + 5;
struct Side {
  int u, v, next;
} s[maxm];
long long ans;
bool sub[maxn];
int size[maxn], Sx, Sy;
int first[maxn], ind;
int n, a, b;
void Insert(int u, int v) {
  s[ind] = (Side){u, v, first[u]}, first[u] = ind++;
  s[ind] = (Side){v, u, first[v]}, first[v] = ind++;
}
void Dfs(int x, int p) {
  size[x] = 1;
  if (x == b) sub[x] = true;
  for (int i = first[x]; i != -1; i = s[i].next)
    if (s[i].v != p) {
      Dfs(s[i].v, x);
      size[x] += size[s[i].v];
      sub[x] |= sub[s[i].v];
    }
}
int main() {
  cin >> n >> a >> b;
  memset(first, (-1), sizeof(first)), ind = 0;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    Insert(u, v);
  }
  Dfs(a, -1);
  Sy = size[b] - 1;
  for (int i = first[a]; i != -1; i = s[i].next)
    if (sub[s[i].v]) Sx = size[a] - size[s[i].v] - 1;
  ans = (long long)n * (n - 1) - (long long)(Sx + 1) * (Sy + 1);
  cout << ans << endl;
  return 0;
}
