#include <bits/stdc++.h>
using namespace std;
vector<int> adj[1000005];
int n;
double dfs(int u, int depth, int parent) {
  int sz = adj[u].size();
  double res = 1.0 / depth;
  for (int i = 0; i < sz; i++) {
    int v = adj[u][i];
    if (v != parent) {
      res += dfs(v, depth + 1, u);
    }
  }
  return res;
}
int main() {
  int u, v;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  printf("%.9lf\n", dfs(1, 1, -1));
  return 0;
}
