#include <bits/stdc++.h>
using namespace std;
long long max(long long x, long long y) { return x > y ? x : y; }
long long min(long long x, long long y) { return x < y ? x : y; }
void _(long long& a, long long b) {
  a = (a % 1000000007 + b % 1000000007) % 1000000007;
  a = (a + 1000000007) % 1000000007;
}
long long b = 0;
long long n, x, y;
vector<long long> e[300000];
long long si[300000];
long long dans;
long long dfs(long long i, long long p) {
  long long ans = 1;
  for (auto j : e[i]) {
    if (j == p) continue;
    ans += dfs(j, i);
    if (i == x and si[y] and !b) {
      dans += si[j], b = 1;
    }
  }
  return si[i] = ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> x >> y;
  x--;
  y--;
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    u--;
    v--;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(x, -1);
  cout << n * (n - 1) - (n - dans) * (si[y]);
}
