#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 3e5 + 10;
const int MAX = 1e9 + 1;
int n, x, y;
vector<int> adj[N];
bool vis[N], vis2[N], vis3[N];
int path[N], path_len;
int cnt;
bool dfs(int cur, int deep) {
  if (cur == y) {
    path_len = deep;
    return 1;
  }
  for (int i = 0; i < adj[cur].size(); ++i) {
    int t = adj[cur][i];
    if (!vis[t]) {
      vis[t] = 1;
      path[deep] = t;
      if (dfs(t, deep + 1)) return 1;
    }
  }
  return 0;
}
void dfs2(int cur, int forbid, bool* vis) {
  for (int i = 0; i < adj[cur].size(); ++i) {
    int t = adj[cur][i];
    if (!vis[t] && t != forbid) {
      ++cnt;
      vis[t] = 1;
      dfs2(t, forbid, vis);
    }
  }
}
int main() {
  int i, j;
  cin >> n >> x >> y;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long total = (long long)n * (long long)(n - 1);
  vis[x] = 1;
  path[0] = x;
  dfs(x, 1);
  vis2[x] = 1;
  dfs2(x, path[1], vis2);
  long long xx = cnt;
  ++xx;
  cnt = 0;
  vis3[y] = 1;
  dfs2(y, path[path_len - 2], vis3);
  long long yy = cnt;
  ++yy;
  cout << total - xx * yy << endl;
  return 0;
}
