#include <bits/stdc++.h>
using namespace std;
const int maxn = 300030;
const int inf = 0x3f3f3f3f;
int n, x, y;
int pre[maxn];
bool vis[maxn], xoy[maxn];
vector<int> mp[maxn];
void init() {
  cin >> n >> x >> y;
  memset(vis, false, sizeof(vis));
  memset(xoy, false, sizeof(xoy));
  memset(pre, -1, sizeof(pre));
  int a, b;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
}
void pridfs(int a, int f) {
  pre[a] = f;
  if (a == y) return;
  int size = mp[a].size();
  for (int i = 0; i < size; i++) {
    int v = mp[a][i];
    if (v != f) {
      pridfs(v, a);
    }
  }
}
int dfs(int u) {
  vis[u] = true;
  int size = mp[u].size();
  int cnt = 1;
  for (int i = 0; i < size; i++) {
    int v = mp[u][i];
    if (!vis[v] && v != x && v != y) {
      cnt += dfs(v);
    }
  }
  return cnt;
}
int main() {
  init();
  pridfs(x, -1);
  for (int i = pre[y]; i != x; i = pre[i]) {
    vis[i] = true;
  }
  int cntx = dfs(x);
  int cnty = dfs(y);
  cout << (long long)n * (n - 1) - (long long)cntx * cnty << endl;
  return 0;
}
