#include <bits/stdc++.h>
using namespace std;
vector<int> g[300010];
long long int n, x, y;
long long int cnt = 0;
long long int cnt2 = 0;
bool flag = 0;
int visit[300010];
void dfs(int i) {
  visit[i] = 1;
  if (i == y) {
    flag = 1;
  }
  if (flag == 1) {
    cnt++;
  }
  for (int j = 0; j < g[i].size(); j++) {
    if (visit[g[i][j]] == 0) {
      dfs(g[i][j]);
    }
  }
  if (i == y) {
    flag = 0;
  }
}
void dfs2(int i) {
  visit[i] = 1;
  if (i == x) {
    flag = 1;
  }
  if (flag == 1) {
    cnt2++;
  }
  for (int j = 0; j < g[i].size(); j++) {
    if (visit[g[i][j]] == 0) {
      dfs2(g[i][j]);
    }
  }
  if (i == x) {
    flag = 0;
  }
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> x >> y;
  for (int i = 0; i < n - 1; i++) {
    int q, w;
    cin >> q >> w;
    g[q].push_back(w);
    g[w].push_back(q);
  }
  long long int ans = n * (n - 1);
  dfs(x);
  for (int i = 1; i <= n; i++) {
    visit[i] = 0;
  }
  dfs2(y);
  long long int c = cnt * cnt2;
  long long int f = ans - c;
  cout << f << endl;
}
