#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3e5;
long long n;
vector<int> graph[MaxN + 5];
vector<int> visited;
vector<long long> stCount;
vector<int> yInTree;
void dispGraph() {
  for (int i = 1; i < n + 1; i++) {
    for (int x : graph[i]) cout << x << " ";
    cout << endl;
  }
}
void dfs(int node) {
  visited[node] = 1;
  for (int i : graph[node]) {
    if (!visited[i]) {
      dfs(i);
      stCount[node] += stCount[i];
      yInTree[node] = yInTree[node] || yInTree[i];
    }
  }
}
int main() {
  int x, y;
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  visited.assign(n + 1, 0);
  stCount.assign(n + 1, 1);
  yInTree.assign(n + 1, 0);
  yInTree[y] = 1;
  stCount[0] = 0;
  dfs(x);
  int Xpar;
  for (int b : graph[x]) {
    if (yInTree[b]) Xpar = b;
  }
  cout << n * (n - 1) - (stCount[y] * (n - stCount[Xpar])) << endl;
}
