#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
long long n, x, y, a, b;
vector<int> v[maxn];
int dfs(int x, int p, int k) {
  int ans = 1;
  for (int i = 0; i < v[x].size(); i++)
    if (v[x][i] != p && v[x][i] != k) ans += dfs(v[x][i], x, k);
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a >> b;
  a--;
  b--;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  x = n - dfs(a, -1, b);
  y = n - dfs(b, -1, a);
  cout << n * (n - 1) - x * y;
  return 0;
}
