#include <bits/stdc++.h>
using namespace std;
void update(vector<long long int>& com_size,
            vector<vector<long long int>>& desc, long long int root) {
  if (!desc[root].size()) {
    com_size[root] = 1;
    return;
  }
  com_size[root] = 1;
  for (int i = 0; i < desc[root].size(); ++i) {
    update(com_size, desc, desc[root][i]);
    com_size[root] += com_size[desc[root][i]];
  }
}
int main() {
  long long int n, x, y;
  cin >> n >> x >> y;
  vector<vector<long long int>> edges(n);
  for (long long int i = 1; i < n; ++i) {
    long long int u, v;
    cin >> u >> v;
    edges[u - 1].push_back(v - 1);
    edges[v - 1].push_back(u - 1);
  }
  vector<vector<long long int>> desc(n);
  vector<long long int> parent(n);
  queue<long long int> qu;
  qu.push(x - 1);
  parent[x - 1] = -1;
  while (!qu.empty()) {
    long long int top = qu.front();
    qu.pop();
    for (int i = 0; i < edges[top].size(); ++i) {
      long long int vert = edges[top][i];
      if (desc[vert].size()) continue;
      qu.push(vert);
      parent[vert] = top;
      desc[top].push_back(vert);
    }
  }
  for (int i = 0; i < n; ++i) {
  }
  vector<long long int> com_size(n);
  update(com_size, desc, x - 1);
  vector<long long int> start;
  start.push_back(y - 1);
  while (start.back() != x - 1) {
    start.push_back(parent[start.back()]);
  }
  start.pop_back();
  long long int imm = start.back();
  cout << com_size[imm] * (n - 1) +
              (n - com_size[imm]) * (n - 1 - com_size[y - 1]);
}
