#include <bits/stdc++.h>
using namespace std;
int pre[300005], vis[300005];
vector<int> g[300005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int f, s;
  long long n;
  while (cin >> n >> f >> s) {
    memset(vis, 0, sizeof(vis));
    ;
    memset(pre, 0, sizeof(pre));
    ;
    for (int i = 1; i < n + 1; i++) g[i].clear();
    for (int i = 1; i < n; i++) {
      int add1, add2;
      cin >> add1 >> add2;
      g[add1].push_back(add2);
      g[add2].push_back(add1);
    }
    queue<int> q;
    q.push(f);
    vis[f] = 1;
    while (!q.empty()) {
      int now = q.front();
      q.pop();
      for (auto i : g[now]) {
        if (!vis[i]) {
          q.push(i);
          vis[i] = 1;
          pre[i] = now;
        }
      }
    }
    long long cnts = 1, cntf = 1;
    int cant = 0;
    memset(vis, 0, sizeof(vis));
    ;
    q.push(s);
    vis[s] = 1;
    while (!q.empty()) {
      int now = q.front();
      q.pop();
      for (auto i : g[now]) {
        if (!vis[i] && i != pre[s]) {
          q.push(i), cnts++, vis[i] = 1;
        }
      }
    }
    cant = s;
    while (pre[cant] != f) cant = pre[cant];
    q.push(f);
    memset(vis, 0, sizeof(vis));
    ;
    vis[f] = 1;
    while (!q.empty()) {
      int now = q.front();
      q.pop();
      for (auto i : g[now]) {
        if (!vis[i] && i != cant) {
          q.push(i), cntf++, vis[i] = 1;
        }
      }
    }
    long long ans = n * (n - 1);
    cout << ans - cntf * cnts << endl;
  }
}
