#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    f |= (ch == '-');
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x = f ? -x : x;
  return;
}
int head[1000001], tot, n, d[1000001];
double ans;
struct note {
  int to, nex, dis;
} e[1000001];
void build(int u, int v) {
  tot++;
  e[tot].to = v;
  e[tot].nex = head[u];
  head[u] = tot;
}
void dfs(int x, int fa) {
  d[x] = d[fa] + 1;
  for (int i = head[x]; i; i = e[i].nex) {
    int y = e[i].to;
    if (y == fa) continue;
    dfs(y, x);
  }
}
int main() {
  read(n);
  for (int i = 1; i < n; i++) {
    int x, y;
    read(x);
    read(y);
    build(x, y);
    build(y, x);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) ans += (double)1 / d[i];
  printf("%.20lf", ans);
  return 0;
}
