#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
std::vector<long long> v[(long long)3e5 + 9];
std::vector<bool> vis((long long)3e5 + 9);
std::vector<bool> vis2((long long)3e5 + 9);
std::vector<long long> size((long long)3e5 + 9, 1);
long long a, b, c = 0;
void dfs(long long u) {
  if (vis[u]) return;
  vis[u] = 1;
  for (long long x : v[u]) {
    if (!vis[x]) {
      dfs(x);
      size[u] += size[x];
    }
  }
}
void dfs2(long long u) {
  if (vis2[u]) return;
  vis2[u] = 1;
  for (long long x : v[u]) {
    if (!vis2[x]) {
      if (x == b && !c) c = u;
      dfs2(x);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n >> a >> b;
  for (long long i = 1; i <= n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(b);
  dfs2(a);
  long long ans = n * (n - 1) - (size[a] * (size[b] - size[c]));
  cout << ans << endl;
}
