#include <bits/stdc++.h>
using namespace std;
long long n, a, b, x, y;
long long s[300010] = {0};
long long visited[300010] = {0};
vector<vector<int>> v(300010);
void dfs(long long n) {
  visited[n] = 1;
  for (int i = 0; i < v[n].size(); i++) {
    if (visited[v[n][i]] == 0) {
      dfs(v[n][i]);
      s[n] += s[v[n][i]];
    }
  }
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    s[i] = 1;
  }
  dfs(a);
  long long p = s[b];
  for (int i = 1; i <= n; i++) {
    s[i] = 1;
    visited[i] = 0;
  }
  dfs(b);
  long long q = s[a];
  if (n >= 2)
    cout << n * (n - 1) - p * q << endl;
  else
    cout << 0 << endl;
}
