#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
struct node {
  int v, next;
  int w;
} e[maxn * 2];
int cnt = 0;
int head[maxn * 2];
void add(int u, int v) {
  e[cnt].v = v;
  e[cnt].next = head[u];
  head[u] = cnt++;
}
long long n, x, y;
long long sum[maxn];
int vis[maxn];
int flag = 0;
long long pre;
void dfs(int u, int key) {
  int i, j;
  vis[u] = 1;
  for (i = head[u]; ~i; i = e[i].next) {
    int v = e[i].v;
    if (vis[v]) continue;
    vis[v] = 1;
    if (v == key) flag = 1, pre = u;
    if (flag) sum[key]++;
    dfs(v, key);
    if (u == pre) flag = 0;
  }
}
int main() {
  cin >> n >> x >> y;
  memset(head, -1, sizeof head);
  for (int i = 1; i <= n - 1; i++) {
    int l, r;
    cin >> l >> r;
    add(l, r);
    add(r, l);
  }
  dfs(x, y);
  flag = 0;
  memset(vis, 0, sizeof vis);
  dfs(y, x);
  long long x2 = cnt;
  cout << n * (n - 1) - sum[x] * sum[y] << endl;
  return 0;
}
