#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, now, head[MAXN], fa[MAXN], dep[MAXN], q[MAXN];
struct Edge {
  int v, nxt;
} e[MAXN * 2];
void addEdge(int u, int v) {
  now++;
  e[now].v = v;
  e[now].nxt = head[u];
  head[u] = now;
}
double bfs() {
  double res = 1.0;
  q[1] = 1;
  dep[1] = 1;
  for (int qh = 1, qt = 1; qh <= qt; qh++) {
    int u = q[qh];
    for (int i = head[u]; i; i = e[i].nxt) {
      int v = e[i].v;
      if (v == fa[u]) continue;
      fa[v] = u;
      dep[v] = dep[u] + 1;
      res += 1.0 / dep[v];
      q[++qt] = v;
    }
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addEdge(u, v);
    addEdge(v, u);
  }
  printf("%.10lf\n", bfs());
  return 0;
}
