#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
vector<int> e[100010];
queue<int> qu;
int vis[100010];
int main() {
  int n, x, y;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  qu.push(1);
  vis[1] = 1;
  double ans = 1;
  while (!qu.empty()) {
    int t = qu.front();
    qu.pop();
    for (int i = 0; i < (int)e[t].size(); i++) {
      int v = e[t][i];
      if (vis[v]) continue;
      vis[v] = vis[t] + 1;
      qu.push(v);
      ans = ans + 1.0 / vis[v];
    }
  }
  printf("%.10lf\n", ans);
}
