#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
vector<int> edge[maxn];
vector<int> ans;
int x, y;
int dfs(int u, int par) {
  int si = 1, v;
  int len = edge[u].size();
  for (int i = 0; i < len; i++) {
    v = edge[u][i];
    if (v != par) si += dfs(v, u);
  }
  if (u == y) ans.push_back(si);
  return si;
}
int main() {
  int T, n, i, j, k, temp;
  long long sum;
  cin >> n >> x >> y;
  int a, b;
  for (i = 1; i <= n - 1; i++) {
    scanf("%d%d", &a, &b);
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  for (i = 0; i <= 1; i++) {
    swap(x, y);
    dfs(x, 0);
  }
  long long Ans = (long long)n * (n - 1) - (long long)ans[0] * ans[1];
  cout << Ans << endl;
}
