#include <bits/stdc++.h>
using namespace std;
long long n, x, y, v[300005], second[300005];
vector<long long> ad[300005];
int dfs(int node) {
  v[node] = 1;
  second[node] = 1;
  long long first = node == y;
  for (auto i : ad[node]) {
    if (!v[i]) {
      if (!dfs(i)) {
        second[node] += second[i];
      } else {
        first = 1;
      }
    }
  }
  return first;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    ad[a].push_back(b);
    ad[b].push_back(a);
  }
  dfs(x);
  cout << n * (n - 1) - second[x] * second[y] << endl;
}
