#include <bits/stdc++.h>
struct Graph {
  int v[(100005 * 2)], pre[(100005 * 2)], ind[100005], n;
  void push_edge(int ui, int vi) {
    int id = ++n;
    v[id] = vi;
    pre[id] = ind[ui];
    ind[ui] = id;
  }
} G;
int N;
double ans;
void dfs(int n, int level, int ori = 0) {
  int m, mid;
  ans += 1.0 / level;
  for (mid = G.ind[n]; mid; mid = G.pre[mid]) {
    m = G.v[mid];
    if (m == ori) continue;
    dfs(m, level + 1, n);
  }
}
int main() {
  int i, j, k;
  scanf("%d", &N);
  for (i = 1; i < N; i++) {
    scanf("%d%d", &j, &k);
    G.push_edge(j, k);
    G.push_edge(k, j);
  }
  dfs(1, 1);
  printf("%.20lf\n", ans);
}
