#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long N = 300005;
int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long powb(long long a, long long b) {
  long long res = 1;
  a;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
vector<int> g[N];
int child[N], vis[N];
void dfs(int s, int par) {
  child[s] = 1;
  for (auto i : g[s]) {
    if (i != par) {
      dfs(i, s);
      child[s] += child[i];
    }
  }
}
void dfs1(int s) {
  vis[s] = 1;
  for (auto i : g[s]) {
    if (!vis[i]) dfs1(i);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, y;
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(y, -1);
  int c = -1;
  vis[y] = 1;
  for (auto i : g[y]) {
    dfs1(i);
    if (vis[x] == 1) {
      c = i;
      break;
    }
  }
  cout << max(0LL, 1LL * n * (n - 1) - 1LL * child[x] * (child[y] - child[c]));
}
