#include <bits/stdc++.h>
using namespace std;
int n, a, b, num, sum = 0, lev[200001], leaflev[101], r, c, k[200000], m,
                  u[200000], flag = 0, cnt = 0, q, p, x, y;
pair<int, int> sz[50];
long long int w;
long long dist[100001], summ, suml, sumr;
vector<int> vii[300001];
int ch[50][50];
bool cycle[101], vis[300001];
vector<int> cyclelist;
string s[1000];
priority_queue<pair<int, pair<int, int> >, vector<pair<int, pair<int, int> > >,
               greater<pair<int, pair<int, int> > > >
    qi;
int dfs(int index) {
  int sum = 1;
  for (int i = 0; i < vii[index].size(); i++) {
    if (index == x) flag = 0;
    if (vis[vii[index][i]] == false) {
      if (vii[index][i] == y)
        flag = 1;
      else {
        vis[vii[index][i]] = true;
        int ans = dfs(vii[index][i]);
        if (index == x) {
          if (flag == 1) {
            summ = ans;
            flag = 0;
          } else
            sum = sum + ans;
        } else
          sum = sum + ans;
      }
    }
  }
  return sum;
}
int main() {
  cin >> n >> x >> y;
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    vii[a].push_back(b);
    vii[b].push_back(a);
  }
  vis[x] = true;
  suml = dfs(x);
  sumr = n - suml - summ;
  long long int f = (suml + summ - 1) * (suml) + (n - 1) * (summ + sumr);
  cout << f;
  return 0;
}
