#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 3e5 + 10;
int par1[maxn], par2[maxn];
long long n;
int x, y;
int Find1(int x) { return par1[x] = par1[x] == x ? x : Find1(par1[x]); }
int Find2(int x) { return par2[x] = par2[x] == x ? x : Find2(par2[x]); }
int main() {
  while (scanf("%lld%d%d", &n, &x, &y) == 3) {
    for (int i = 1; i <= n; ++i) {
      par1[i] = par2[i] = i;
    }
    for (int i = 1, a, b; i < n; ++i) {
      scanf("%d%d", &a, &b);
      if (a != x && b != x) {
        int fa = Find1(a);
        int fb = Find1(b);
        if (fa != fb) par1[fa] = fb;
      }
      if (a != y && b != y) {
        int fa = Find2(a);
        int fb = Find2(b);
        if (fa != fb) par2[fa] = fb;
      }
    }
    long long a = 0, b = 0;
    for (int i = 1; i <= n; ++i) {
      if (Find1(i) != Find1(y)) ++a;
      if (Find2(i) != Find2(x)) ++b;
    }
    printf("%lld\n", n * (n - 1) - a * b);
  }
  return 0;
}
