#include <bits/stdc++.h>
using namespace std;
int par[3 * 100005], S[3 * 100005] = {0};
vector<vector<int> > G(3 * 100005);
int DFS(int root, int p) {
  par[root] = p;
  S[root]++;
  for (int i = 0; i < G[root].size(); i += 1)
    if (G[root][i] != p) S[root] += DFS(G[root][i], root);
  return S[root];
}
int main() {
  int n, x, y, u, v;
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i += 1) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  DFS(x, 0);
  int i = y;
  while (par[i] != x) i = par[i];
  long long int ans = 1LL * (n - S[i]) * S[y];
  cout << 1LL * n * (n - 1) - ans << '\n';
}
