#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > v(1000000);
vector<int> d;
vector<bool> visited(1000000);
set<int> s;
queue<int> q;
int counterrr;
void dfs(int node, int x, int y, bool flower, bool deel) {
  visited[node] = 1;
  bool gg = 0;
  if (deel == 1) counterrr++;
  for (int i = 0; i < (int)v[node].size(); i++) {
    if (!visited[v[node][i]]) {
      gg = 1;
      if (v[node][i] == x) {
        dfs(v[node][i], x, y, 1, deel);
      } else if (v[node][i] == y) {
        if (flower == 1) {
          dfs(v[node][i], x, y, flower, 1);
        } else {
          dfs(v[node][i], x, y, flower, deel);
        }
      } else {
        dfs(v[node][i], x, y, flower, deel);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long x, y, n;
  long long f, s;
  cin >> n;
  long long sum = n * (n - 1);
  cin >> f >> s;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  long long counter_root = 0, counter_node = 0;
  std::fill(visited.begin(), visited.end(), 0);
  dfs(f, f, s, 1, 0);
  counter_root = counterrr;
  counterrr = 0;
  std::fill(visited.begin(), visited.end(), 0);
  dfs(s, s, f, 1, 0);
  counter_node = counterrr;
  if (n == 1)
    cout << 0;
  else
    cout << sum - (counter_node * counter_root);
  return 0;
}
