#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
vector<long long int> v[300005];
int a[300005];
long long int sub_sz[300005];
bool chk_sb[300005];
long long int m, k;
bool flag = false;
long long int dfs(int i) {
  a[i] = 1;
  sub_sz[i] = 1;
  if (i == m) {
    chk_sb[i] = true;
  } else {
    chk_sb[i] = false;
  }
  for (auto c : v[i]) {
    if (!a[c]) {
      sub_sz[i] += dfs(c);
      chk_sb[i] |= chk_sb[c];
    }
  }
  return sub_sz[i];
}
void solve() {
  long long int n;
  cin >> n >> m >> k;
  for (int i = 0; i < n - 1; i += 1) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  long long int count = n * (n - 1);
  int x = dfs(k);
  long long int fin;
  for (auto c : v[k]) {
    if (chk_sb[c]) {
      fin = sub_sz[k] - sub_sz[c];
      break;
    }
  }
  count -= (fin * sub_sz[m]);
  cout << count << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q = 1;
  while (q--) {
    solve();
  }
}
