#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 7;
int o[maxn], anc[maxn], siz[maxn];
vector<int> e[maxn];
bool vis[maxn];
void bfs(int root) {
  int h = 0, t = 0;
  o[h] = root;
  anc[root] = -1;
  while (h <= t) {
    int u = o[h++];
    for (int i = e[u].size() - 1; i >= 0; i--) {
      int v = e[u][i];
      if (v == anc[u]) continue;
      o[++t] = v;
      anc[v] = u;
    }
  }
  for (int i = t; i >= 1; i--) {
    int u = o[i];
    siz[u]++;
    siz[anc[u]] += siz[u];
  }
}
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  if (n == 2) {
    printf("1\n");
    return 0;
  }
  int root = x;
  bfs(root);
  siz[root]++;
  int u = y;
  while (u != -1) {
    vis[u] = true;
    u = anc[u];
  }
  long long c = 1;
  for (int &i : e[root])
    if (!vis[i]) c += siz[i];
  long long ans = (long long)n * (n - 1);
  cout << ans - (long long)c * siz[y] << endl;
  return 0;
}
