#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  T f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
const int maxn = 100010;
struct edge {
  int to, nxt;
} e[maxn << 1];
int n, num, dep[maxn], head[maxn];
double ans;
void addedge(int u, int v) {
  e[++num].to = v;
  e[num].nxt = head[u];
  head[u] = num;
  e[++num].to = u;
  e[num].nxt = head[v];
  head[v] = num;
}
void Dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = e[i].nxt)
    if (e[i].to != fa) Dfs(e[i].to, x);
}
int main() {
  read(n);
  for (int i = (1), iend = (n - 1); i <= iend; i++) {
    int u, v;
    read(u);
    read(v);
    addedge(u, v);
  }
  Dfs(1, 0);
  for (int i = (1), iend = (n); i <= iend; i++) ans += 1.0 / dep[i];
  printf("%.15lf\n", ans);
  return 0;
}
