#include <bits/stdc++.h>
using namespace std;
int N = (int)1e5 * 3 + 5;
int x, y;
vector<vector<int> > graph(N, vector<int>(0));
vector<int> vis(N, -1);
pair<int, int> dfs(int v, bool found) {
  if (vis[v] > 0) {
    return make_pair(0, 0);
  }
  vis[v] = 1;
  found |= (v == y);
  pair<int, int> res = make_pair(1, found);
  for (int u : graph[v]) {
    int a, b;
    tie(a, b) = dfs(u, found);
    if (b > 0) {
      res.second += b;
    } else {
      res.first += a;
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long m;
  cin >> m >> x >> y;
  for (int i = 0; i < (m - 1); i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  int a, b;
  tie(a, b) = dfs(x, 0);
  cout << (m * (m - 1) - (long long)a * (long long)b);
  return 0;
}
