#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int n, x, y;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
vector<int> G[300001];
int lsz = -1, rsz = -1;
int dfs(int v, int par) {
  int s = 1;
  int fl = -1;
  for (int i = 0; i < G[v].size(); i++) {
    if (G[v][i] != par) {
      s = s + dfs(G[v][i], v);
      if (rsz != -1 && fl == -1) {
        fl = i;
      }
    }
  }
  if (v == y) {
    rsz = s;
  }
  if (v == x) {
    lsz = 1;
    for (int i = 0; i < G[v].size(); i++) {
      if (G[v][i] != par && i != fl) {
        lsz = lsz + dfs(G[v][i], v);
      }
    }
  }
  return s;
}
int main() {
  int i, j, fl, test;
  scanf("%d%d%d", &n, &x, &y);
  for (i = 0; i < n - 1; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    G[l].push_back(r);
    G[r].push_back(l);
  }
  dfs(x, -1);
  long long ans = n;
  ans = ans * (n - 1);
  long long t = lsz;
  ans = ans - (t * rsz);
  printf("%lld\n", ans);
  return 0;
}
