#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, m, u, v;
  cin >> n;
  vector<vector<int> > e = vector<vector<int> >(n + 1);
  for (i = 0; i < n - 1; i++) {
    cin >> u >> v;
    e[u].push_back(v);
    swap(u, v);
    e[u].push_back(v);
  }
  vector<int> d = vector<int>(n + 1, 0);
  queue<int> q;
  q.push(1);
  d[1] = 1;
  double ans = 0;
  while (!q.empty()) {
    u = q.front();
    q.pop();
    ans += 1.0 / d[u];
    for (i = 0; i < ((int)(e[u]).size()); i++) {
      v = e[u][i];
      if (d[v]) continue;
      d[v] = d[u] + 1;
      q.push(v);
    }
  }
  printf("%.10lf\n", ans);
  return 0;
}
