#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
struct node {
  vector<long long> ed;
  long long visited;
};
node N[300002];
long long subtree(long long x) {
  long long i, j;
  long long y;
  long long counter = 0;
  queue<long long> q;
  q.push(x);
  while (!q.empty()) {
    y = q.front();
    q.pop();
    if (N[y].visited == 0) {
      N[y].visited = 1;
      counter++;
      for (i = 0; i < N[y].ed.size(); i++) {
        if (N[N[y].ed[i]].visited == 0) {
          q.push(N[y].ed[i]);
        }
      }
    }
  }
  return counter;
}
void unmark(long long a, long long b, long long c) {
  queue<long long> q;
  q.push(a);
  long long i;
  long long x;
  while (!q.empty()) {
    x = q.front();
    q.pop();
    N[x].visited = 0;
    for (i = 0; i < N[x].ed.size(); i++) {
      if ((N[x].ed[i] != b) && (N[x].ed[i] != c) &&
          (N[N[x].ed[i]].visited == 1)) {
        q.push(N[x].ed[i]);
      }
    }
  }
}
long long getbcount(long long y) {
  long long counter = 0;
  queue<long long> q;
  q.push(y);
  long long i, x;
  while (!q.empty()) {
    x = q.front();
    q.pop();
    N[x].visited = 0;
    counter++;
    for (i = 0; i < N[x].ed.size(); i++) {
      if (N[N[x].ed[i]].visited == 1) {
        q.push(N[x].ed[i]);
      }
    }
  }
  return counter;
}
int main() {
  long long n, x, y;
  cin >> n >> x >> y;
  long long i, j, a, b;
  N[0].visited = 0;
  N[n].visited = 0;
  for (i = 0; i < n - 1; i++) {
    N[i + 1].visited = 0;
    cin >> a >> b;
    N[a].ed.push_back(b);
    N[b].ed.push_back(a);
  }
  long long countsub = 1;
  N[x].visited = 1;
  for (i = 0; i < N[x].ed.size(); i++) {
    j = subtree(N[x].ed[i]);
    if (N[y].visited == 1) {
      if (N[x].ed[i] != y) {
        unmark(N[x].ed[i], x, y);
      }
      N[y].visited = 0;
    } else {
      countsub += j;
    }
  }
  N[x].visited = 0;
  N[y].visited = 1;
  long long countb = getbcount(y);
  long long val;
  val = n * (n - 1);
  val -= countsub * countb;
  cout << val << endl;
}
