#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
struct Edge {
  int v, next;
} edge[MAXN << 1];
int head[MAXN], tail, n;
void insert(int u, int v) {
  edge[++tail] = (Edge){v, head[u]};
  head[u] = tail;
}
namespace solver1 {
int dep[MAXN];
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].v;
    if (v == fa) continue;
    dfs(v, u);
  }
}
void main() {
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 1.0 / dep[i];
  }
  printf("%.8f\n", ans);
}
}  // namespace solver1
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    insert(u, v);
    insert(v, u);
  }
  solver1::main();
}
