#include <bits/stdc++.h>
using namespace std;
int sz[301010];
bool used[301010];
vector<int> g[301010];
void dfs(int v) {
  used[v] = 1;
  for (int to : g[v])
    if (!used[to]) dfs(to), sz[v] += sz[to];
  sz[v]++;
}
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  for (int i = 1, a, b; i < n; i++) {
    cin >> a >> b;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  dfs(x);
  int cnt = sz[y];
  memset(used, 0, sizeof used);
  memset(sz, 0, sizeof sz);
  dfs(y);
  cout << (1ll * n * (n - 1)) - (1ll * sz[x] * cnt);
}
