#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
vector<int> g[maxn];
long double dfs(int v = 0, int p = -1) {
  long double sum = 0;
  for (auto u : g[v]) {
    if (u != p) {
      sum += dfs(u, v) + 1;
    }
  }
  return sum ? sum / (g[v].size() - (p != -1)) : 0;
}
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 0; i < (int)(n - 1); ++i) {
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << fixed << setprecision(7) << dfs() << endl;
  return 0;
}
