#include <bits/stdc++.h>
using namespace std;
long long ok;
long long a, b;
long long A[5];
long long vis[300010];
long long n, x, y;
vector<long long> E[300010];
void dfs(long long node, long long pr, long long t) {
  for (auto i : E[node])
    if (vis[i] == 0 && pr != i) dfs(i, node, t);
  A[t]++;
}
void dfs2(long long node) {
  vis[node] = 1;
  if (node == y) {
    ok = 1;
    return;
  }
  for (auto i : E[node])
    if (vis[i] == 0) {
      dfs2(i);
      if (ok == 1) return;
    }
  vis[node] = 0;
}
int main() {
  cin >> n >> x >> y;
  for (long long i = 1; i < n; i++) {
    cin >> a >> b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  dfs2(x);
  dfs(x, 0, 1);
  dfs(y, 0, 2);
  cout << n * (n - 1) - A[1] * A[2];
}
