#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
int dx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
int dy[8] = {0, -1, 0, 1, 1, -1, 1, -1};
char dir[4] = {'u', 'l', 'd', 'r'};
long long int cmp1(pair<long long int, string> a,
                   pair<long long int, string> b) {
  if (a.first != b.first)
    return a.first < b.first;
  else
    return a.second < b.second;
}
long long int ans = 0;
void helper(vector<vector<int>>& graph, int t, int x, int y,
            vector<vector<vector<int>>>& dp) {
  if (x == y) return;
  if (dp[t][x][y] != -1) return;
  bool mouseTurn = (t % 2 == 0);
  if (mouseTurn) {
    bool catWin = true;
    for (int i = 0; i < graph[x].size(); ++i) {
      helper(graph, t + 1, graph[x][i], y, dp);
    }
    if (catWin) return;
  } else {
    ans++;
    for (int i = 0; i < graph[y].size(); ++i) {
      if (graph[y][i] == 0) continue;
      helper(graph, t + 1, x, graph[y][i], dp);
    }
    return;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<vector<int>> ab;
  int n, u, v;
  cin >> n >> u >> v;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    ab[a].push_back(b);
    ab[b].push_back(a);
  }
  vector<vector<vector<int>>> dp(2 * n,
                                 vector<vector<int>>(n, vector<int>(n, -1)));
  helper(ab, 0, u, v, dp);
  cout << ans << endl;
  return 0;
}
