#include <bits/stdc++.h>
using namespace std;
void io_in_data() {
  freopen("data.in", "r", stdin);
  freopen("data.out", "w", stdout);
}
const int MAXN = 100007;
int fe[MAXN], to[MAXN << 1], ne[MAXN << 1], ecnt;
int dp[MAXN];
void addedge(int u, int v) {
  to[ecnt] = v;
  ne[ecnt] = fe[u];
  fe[u] = ecnt++;
}
void dfs(int u, int fa, int deep) {
  dp[u] = deep;
  for (int e = fe[u]; e != -1; e = ne[e]) {
    int v = to[e];
    if (v != fa) dfs(v, u, deep + 1);
  }
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(fe, -1, sizeof(fe));
    ecnt = 0;
    for (int i = 1; i < n; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      addedge(u, v);
      addedge(v, u);
    }
    dfs(1, -1, 1);
    double ans = 0;
    for (int i = 1; i <= n; i++) ans += 1.0 / dp[i];
    printf("%lf\n", ans);
  }
  return 0;
}
