#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 5;
vector<int> v[N];
int seen[N];
int k, x, y;
void dfs(int src, int par = -1) {
  seen[src] |= k;
  for (auto i : v[src]) {
    if (i != par && i != x && i != y) {
      dfs(i, src);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n >> x >> y;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  k = 1;
  dfs(x);
  k = 2;
  dfs(y);
  int x_sz = 0, y_sz = 0;
  for (int i = 1; i <= n; i++) {
    if (seen[i] == 1)
      x_sz++;
    else if (seen[i] == 2)
      y_sz++;
  }
  long long ans = 1ll * n * (n - 1);
  ans -= 1ll * x_sz * y_sz;
  cout << ans;
  return 0;
}
