#include <bits/stdc++.h>
using namespace std;
int n, dep[100010], h[100010], cnt = 0;
double ans = 0.0;
int gi() {
  int w = 0, f = 1;
  char ch;
  while (!isdigit(ch)) {
    f = ch == '-' ? -1 : 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    w = (w << 1) + (w << 3) + ch - 48;
    ch = getchar();
  }
  return w * f;
}
struct edge {
  int v, nxt;
} e[100010 << 1];
void add(int u, int v) {
  e[++cnt] = (edge){v, h[u]};
  h[u] = cnt;
}
void dfs(int x, int fx) {
  dep[x] = dep[fx] + 1;
  for (int i = h[x]; i; i = e[i].nxt) {
    if (e[i].v != fx) {
      dfs(e[i].v, x);
    }
  }
}
int main() {
  n = gi();
  for (int i = 1; i < n; i++) {
    int u = gi(), v = gi();
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    ans += 1.0 / dep[i];
  }
  printf("%.10lf", ans);
}
