#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5;
vector<int> G[MAX + 7];
int son[MAX + 7];
bool col[MAX + 7], vis[MAX + 7];
int n, x, y;
void dfs(int u) {
  vis[u] = 1;
  son[u] = 1;
  if (u == x)
    col[u] = 1;
  else
    col[u] = 0;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (vis[v]) continue;
    dfs(v);
    son[u] += son[v];
    col[u] |= col[v];
  }
  return;
}
void solve() {
  cin >> n >> x >> y;
  for (int i = 0; i <= n; i++) G[i].clear();
  for (int i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(y);
  long long sum = 1LL * n * (n - 1);
  long long minus_son;
  for (int i = 0; i < G[y].size(); i++) {
    int u = G[y][i];
    if (col[u]) {
      minus_son = 1LL * (n - son[u]) * son[x];
      break;
    }
  }
  long long ans = 1LL * sum - minus_son;
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
