#include <bits/stdc++.h>
using namespace std;
int n, s, e;
vector<bool> vis(300001);
vector<long long> cnt(300001);
vector<int> G[300001], par(300001);
void DFS(int v) {
  cnt[v] = 1;
  vis[v] = true;
  for (int u : G[v]) {
    if (!vis[u]) {
      DFS(u);
      par[u] = v;
      cnt[v] += cnt[u];
    }
  }
}
int main() {
  cin >> n >> s >> e;
  for (int i = 1; i < n; i++) {
    int v, u;
    cin >> v >> u;
    G[v].push_back(u);
    G[u].push_back(v);
  }
  DFS(s);
  int v = e;
  while (par[v] != s) v = par[v];
  long long x = n, y = cnt[s] - cnt[v], z = cnt[e];
  cout << x * (x - 1) - y * z;
  return 0;
}
