#include <bits/stdc++.h>
using namespace std;
inline int getint() {
  char c;
  int f = 0;
  while (c = getchar(), c > '9' || c < '0')
    ;
  while (f = (f << 1) + (f << 3) + c - '0', c = getchar(), c >= '0' && c <= '9')
    ;
  return f;
}
const int N = 1e5 + 5;
int n, a, b;
struct Edge {
  int to, next;
} edge[N << 1];
int deep[N];
int sum_edge, head[N];
inline void add_edge(int from, int to) {
  ++sum_edge;
  edge[sum_edge].to = to;
  edge[sum_edge].next = head[from];
  head[from] = sum_edge;
}
inline void dfs(int u, int fa) {
  for (register int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    deep[v] = deep[u] + 1;
    dfs(v, u);
  }
}
int main() {
  n = getint();
  for (register int i = 1; i < n; ++i) {
    a = getint(), b = getint();
    add_edge(a, b);
    add_edge(b, a);
  }
  deep[1] = 1;
  dfs(1, 0);
  double ans = 0;
  for (register int i = 1; i <= n; ++i) ans += 1. / (double(deep[i]));
  printf("%.20lf\n", ans);
  return 0;
}
