#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5 + 5);
vector<int> graph[N];
bool mark[N];
double dfs(int cur) {
  mark[cur] = 1;
  int cnt = 0;
  double len = 0;
  for (int city : graph[cur]) {
    if (mark[city]) continue;
    ++cnt;
    len += 1 + dfs(city);
  }
  if (cnt) return len / cnt;
  return 0;
}
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1, x, y; i < n; ++i) {
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  cout << setprecision(10);
  cout << dfs(1);
}
