#include <bits/stdc++.h>
using namespace std;
vector<long long> v[300005];
bool vis[300005];
long long val[300005];
void dfs(long long idx) {
  vis[idx] = true;
  long long index;
  val[idx] = 1;
  for (long long i = 0; i < v[idx].size(); i++) {
    index = v[idx][i];
    if (!vis[index]) {
      dfs(index);
      val[idx] += val[index];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  long long n, x, y;
  cin >> n >> x >> y;
  long long i, a, b;
  for (i = 0; i < (n - 1); i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  memset(vis, false, sizeof vis);
  dfs(x);
  long long ans = 0;
  ans = (n * (n - 1));
  long long pre = val[y];
  memset(vis, false, sizeof vis);
  memset(val, 0, sizeof val);
  dfs(y);
  long long jk = val[x];
  ans = ans - pre * jk;
  cout << ans;
}
