#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:836777216")
using namespace std;
vector<vector<int> > g;
int cnt[300005];
bool fnd[300005];
int n, x, y;
void dfs(int v, int p = -1) {
  cnt[v] = 1;
  if (v == y) {
    fnd[v] = 1;
  }
  for (int(i) = 0; (i) < ((int)(g[v]).size()); (i)++) {
    int u = g[v][i];
    if (u != p) {
      dfs(u, v);
      cnt[v] += cnt[u];
      if (fnd[u]) {
        fnd[v] = 1;
      }
    }
  }
}
int main(void) {
  scanf("%d%d%d", &n, &x, &y);
  x--, y--;
  g.resize(n);
  for (int(i) = 0; (i) < (n - 1); (i)++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(x);
  int left = n;
  for (int(i) = 0; (i) < ((int)(g[x]).size()); (i)++) {
    int u = g[x][i];
    if (fnd[u]) {
      left -= cnt[u];
    }
  }
  int right = cnt[y];
  long long total =
      (long long)n * (long long)(n - 1) - (long long)left * (long long)right;
  printf("%lld\n", total);
}
