#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct graph {
  int size;
  vector<list<int>> adj;
  graph(int n) : size(n), adj(n) {}
  void addEdge(int a, int b) {
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
};
pair<int, int> path(graph& g, int x, int y) {
  vector<bool> visit(g.size, false);
  vector<int> par(g.size, -1);
  queue<int> q;
  visit[x] = 1;
  q.push(x);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto& v : g.adj[u]) {
      if (visit[v]) continue;
      visit[v] = true;
      par[v] = u;
      q.push(v);
    }
  }
  pair<int, int> ans(0, par[y]);
  int p = y;
  while (p != -1) {
    if (par[p] == x) ans.first = p;
    p = par[p];
  }
  return ans;
}
int countChild(graph& g, int u, int ign, int p = -1) {
  int cnt = 1;
  for (auto& v : g.adj[u]) {
    if (v == ign or v == p) continue;
    cnt += countChild(g, v, -1, u);
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, x, y;
  cin >> n >> x >> y;
  x--, y--;
  graph g(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g.addEdge(a - 1, b - 1);
  }
  auto [f, b] = path(g, x, y);
  long long p = countChild(g, x, f);
  long long q = countChild(g, y, b);
  cout << n * (n - 1) - p * q << "\n";
  return 0;
}
