#include <bits/stdc++.h>
using namespace std;
long long cnt = 0;
long long cnt1 = 0;
long long flag = 0;
void dfs(vector<long long> G[], long long x, long long y,
         vector<long long> &visit, long long i) {
  visit[i] = 1;
  if ((visit[y] == 0 || visit[y] == 2) && i != y) {
    cnt++;
  }
  for (int j = 0; j < G[i].size(); j++) {
    if (visit[G[i][j]] == 0) {
      dfs(G, x, y, visit, G[i][j]);
    }
  }
  visit[i] = 2;
}
void dfs1(vector<long long> G[], long long x, long long y,
          vector<long long> &visit, long long i) {
  visit[i] = 1;
  if ((visit[x] == 0 || visit[x] == 2) && i != x) {
    cnt1++;
  }
  for (int j = 0; j < G[i].size(); j++) {
    if (visit[G[i][j]] == 0) {
      dfs1(G, x, y, visit, G[i][j]);
    }
  }
  visit[i] = 2;
}
int main() {
  long long nodes, x, y;
  cin >> nodes >> x >> y;
  vector<long long> G[nodes + 1];
  vector<long long> visit(nodes + 1, 0);
  for (int i = 0; i < nodes - 1; i++) {
    int a, b;
    cin >> a >> b;
    ;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(G, x, y, visit, x);
  fill(visit.begin(), visit.end(), 0);
  dfs1(G, x, y, visit, y);
  cnt = nodes - cnt;
  cnt1 = nodes - cnt1;
  cout << nodes * (nodes - 1) - cnt * cnt1 << endl;
}
