#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
vector<vector<long long>> graph;
long long dfs1(long long pos, long long par, bool& d) {
  if (pos == y) {
    d = true;
    return 0;
  }
  long long ret = 1;
  for (long long i = 0; i < (long long)(long long)graph[pos].size(); i++) {
    if (graph[pos][i] == par) continue;
    bool f = false;
    long long buf = dfs1(graph[pos][i], pos, f);
    if (f)
      d = true;
    else
      ret += buf;
  }
  return ret;
}
long long dfs2(long long pos, long long par, bool& d) {
  if (pos == x) {
    d = true;
    return 0;
  }
  long long ret = 1;
  for (long long i = 0; i < (long long)(long long)graph[pos].size(); i++) {
    if (graph[pos][i] == par) continue;
    bool f = false;
    long long buf = dfs2(graph[pos][i], pos, f);
    if (f)
      d = true;
    else
      ret += buf;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> x >> y;
  x--;
  y--;
  graph.resize(n);
  for (long long i = 0; i < (long long)n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  long long ans = n * n - n;
  bool hoge1 = false, hoge2 = false;
  long long nf = dfs1(x, -1, hoge1), nb = dfs2(y, -1, hoge2);
  cout << ans - nf * nb << endl;
}
