#include <bits/stdc++.h>
using namespace std;
double ans = 0;
vector<int> edgeList[100005];
bool visited[100005];
int dfsNumber = 0;
double city = 0;
vector<int> lengths;
double DFS(int node, int parent) {
  double res = 0;
  int child = 0;
  for (int i = 0; i < edgeList[node].size(); i++) {
    if (edgeList[node][i] == parent) continue;
    child++;
    res += DFS(edgeList[node][i], node);
  }
  if (child == 0) return 0;
  return (res / child) + 1.00;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    edgeList[u].push_back(v);
    edgeList[v].push_back(u);
  }
  printf("%.7f", DFS(1, 0));
  return 0;
}
