#include <bits/stdc++.h>
using namespace std;
int n;
double ans = 0;
int tot = 0, head[100010];
struct EDGE {
  int nxt, to;
} edge[200010];
inline void add(int u, int v) {
  edge[++tot].nxt = head[u];
  edge[tot].to = v;
  head[u] = tot;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
void dfs(int x, int f, int dep) {
  ans += 1.0 / dep;
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].to;
    if (y == f) continue;
    dfs(y, x, dep + 1);
  }
}
int main() {
  n = read();
  for (int i = 2; i <= n; ++i) {
    int u = read(), v = read();
    add(u, v), add(v, u);
  }
  dfs(1, 0, 1);
  printf("%.8f", ans);
  return 0;
}
