#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    ch = getchar();
  }
  while (isdigit(ch)) {
    ans = (ans << 3) + (ans << 1) + (ch ^ 48), ch = getchar();
  }
  ans = ans + 0 + 0 + 0 + 0 + 0;
  return ans;
}
int first[100005], n, cnt, dep[100005];
double ans = 0;
struct edge {
  int v, next;
} e[100005 << 1];
inline void add(int u, int v) {
  e[++cnt].v = v, e[cnt].next = first[u], first[u] = cnt;
}
inline void dfs(int p, int fa) {
  for (int i = first[p]; i; i = e[i].next) {
    int v = e[i].v;
    if (v == fa) continue;
    dep[v] = dep[p] + 1, dfs(v, p);
  }
}
int main() {
  n = read();
  for (int i = 1; i < n; ++i) {
    int u = read(), v = read();
    add(u, v), add(v, u);
  }
  dep[1] = 1, dfs(1, 1);
  for (int i = 1; i <= n; ++i) ans += 1.0 / (1.0 * dep[i]);
  printf("%.20lf", ans);
  return 0;
}
