#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
vector<int> dest;
int main() {
  int n, u, v;
  cin >> n;
  adj.resize(n);
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dest.resize(n, -1);
  queue<int> q;
  q.push(0);
  dest[0] = 0;
  int lvl = 1;
  double ans = 0;
  while (q.size()) {
    int sz = q.size();
    while (sz--) {
      int node = q.front();
      q.pop();
      for (int i = 0; i < adj[node].size(); i++) {
        int to = adj[node][i];
        if (dest[to] == -1) {
          dest[to] = lvl;
          q.push(to);
        }
      }
    }
    lvl++;
  }
  for (int i = 0; i < n; i++) {
    ans += 1.0 / (dest[i] + 1);
  }
  printf("%lf", ans);
  return 0;
}
