#include <bits/stdc++.h>
using namespace std;
vector<long long> G[300005];
int vis[300005];
long long dfs(long long u, long long y) {
  if (u == y) return -1;
  vis[u] = 1;
  long long tmp = 0;
  long long ans = 0;
  for (int i = 0; i < G[u].size(); i++) {
    long long v = G[u][i];
    if (vis[v] == 0) {
      tmp = dfs(v, y);
      if (tmp == -1) return -1;
      ans += tmp;
    }
  }
  return ans + 1;
}
int main() {
  long long n;
  long long x, y;
  scanf("%lld%lld%lld", &n, &x, &y);
  long long u, v;
  for (int i = 1; i < n; i++) {
    scanf("%lld%lld", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  memset(vis, 0, sizeof(vis));
  long long ans1 = 0, ans2 = 0;
  vis[x] = 1;
  long long temp;
  for (int i = 0; i < G[x].size(); i++) {
    long long u = G[x][i];
    temp = dfs(u, y);
    if (temp != -1) ans1 += temp;
  }
  memset(vis, 0, sizeof(vis));
  vis[y] = 1;
  for (int i = 0; i < G[y].size(); i++) {
    long long u = G[y][i];
    temp = dfs(u, x);
    if (temp != -1) ans2 += temp;
  }
  printf("%lld\n", n * (n - 1) - (ans1 + 1) * (ans2 + 1));
  return 0;
}
