#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
long long cnt;
vector<long long> g[(long long)3e5 + 2];
void dfs(int s, int p, int d) {
  cnt++;
  for (auto e : g[s]) {
    if (e == p || e == d) continue;
    dfs(e, s, d);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    long long n, a, b;
    cin >> n >> a >> b;
    for (long long i = 0; i < int(n - 1); ++i) {
      long long x, y;
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    cnt = 0;
    dfs(a, a, b);
    long long f1 = n - cnt;
    cnt = 0;
    dfs(b, b, a);
    long long f2 = n - cnt;
    cout << n * (n - 1) - f1 * f2;
  }
  return 0;
}
