#include <bits/stdc++.h>
using namespace std;
void pv(vector<long long int> arr, long long int size) {
  for (long long int i = 0; i < size; i++) {
    cout << arr[i] << ' ';
  }
}
void gv(vector<long long int> &arr) {
  long long int size = arr.size();
  for (long long int i = 0; i < size; i++) {
    cin >> arr[i];
  }
}
float tr(long long int v, vector<vector<long long int>> &adj,
         vector<long long int> &visited) {
  visited[v] = 1;
  float c = 0;
  long long int k = 0;
  for (long long int i = 0; i < adj[v].size(); i++) {
    if (visited[adj[v][i]] == 0) {
      c += tr(adj[v][i], adj, visited);
      k++;
    }
  }
  if (k == 0)
    return 0;
  else
    return 1 + (c) / k;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<vector<long long int>> adj(n + 1);
  vector<long long int> visited(n + 1, 0), par(n + 1, 0);
  for (long long int i = 0; i < n - 1; i++) {
    long long int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  cout << setprecision(10) << fixed << tr(1, adj, visited);
  return 0;
}
