#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  int n;
  double e[100005];
  vector<int> g[100005];
  void dfs(int u, int p = 0) {
    int child = 0;
    for (int v : g[u])
      if (v - p) child++;
    if (child > 0) {
      e[u] = 1.0;
    } else {
      e[u] = 0.0;
    }
    for (int v : g[u])
      if (v - p) {
        dfs(v, u);
        e[u] += e[v] / child;
      }
  }
  void solve(std::istream& in, std::ostream& out) {
    in >> n;
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      in >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
    }
    dfs(1);
    cout << e[1] << endl;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12) << fixed;
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
