#include <bits/stdc++.h>
int read() {
  int ch = getchar(), num = 0;
  while (ch < 48 || ch > 57) ch = getchar();
  while (ch >= 48 && ch <= 57)
    num = (num << 3) + (num << 1) + (ch ^ 48), ch = getchar();
  return num;
}
const int maxn = 100005;
int n, total, head[maxn], to[maxn << 1], next[maxn << 1];
void add(int u, int v) {
  to[++total] = v;
  next[total] = head[u];
  head[u] = total;
}
int depth[maxn];
double answer = 0.0;
void dfs(int u, int from) {
  answer += 1.0 / (double)(depth[u] = depth[from] + 1);
  for (int i = head[u]; i; i = next[i]) {
    int v = to[i];
    if (v != from) dfs(v, u);
  }
}
int main() {
  n = read();
  int u, v;
  for (int i = 1; i < n; i++) {
    u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  printf("%.9lf", answer);
  return 0;
}
