#include <bits/stdc++.h>
using namespace std;
inline long long power(long long a, long long b) {
  long long x = 1;
  a = a % 1000000007ULL;
  while (b) {
    if (b & 1) x = (x * a) % 1000000007ULL;
    a = (a * a) % 1000000007ULL;
    b >>= 1;
  }
  return x;
}
inline long long inv(long long a) { return power(a, 1000000007ULL - 2); }
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
const int N = 3e5 + 5;
vector<int> adj[N];
long long n, x, y;
long long h[N];
void dfs(int u, int par) {
  h[u] = 1;
  for (auto v : adj[u]) {
    if (v != par) {
      dfs(v, u);
      h[u] += h[v];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> x >> y;
  int u, v;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  memset(h, -1, sizeof(h));
  dfs(x, -1);
  long long ans = (n * (n - 1LL));
  long long diff = h[y];
  memset(h, -1, sizeof(h));
  dfs(y, -1);
  diff *= h[x];
  ans -= diff;
  cout << ans << endl;
  return 0;
}
