#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int INF = 1e9 + 7;
const int mod = 1e9 + 7;
struct edge {
  int to, nxt;
} e[MAXN << 1];
int head[MAXN], num_edge = 0;
int n, dep[MAXN];
double ans = 0;
int read() {
  int s = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
  while (isdigit(ch)) s = (s << 1) + (s << 3) + ch - '0', ch = getchar();
  return f ? -s : s;
}
void add_edge(int from, int to) {
  e[++num_edge] = (edge){to, head[from]}, head[from] = num_edge;
}
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  for (int i = head[u]; i; i = e[i].nxt)
    if (e[i].to != fa) dfs(e[i].to, u);
}
int main() {
  n = read();
  for (int i = 1, u, v; i < n; ++i)
    u = read(), v = read(), add_edge(u, v), add_edge(v, u);
  dfs(1, 0);
  for (int i = 1; i <= n; ++i) ans += 1.0 / dep[i];
  printf("%.20lf", ans);
  return 0;
}
