#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 1e5 + 5, M = 2 * N + 5;
int head[N], nxt[M], to[M], ne, n;
void init() {
  ne = 0;
  memset(head, -1, n * sizeof head[0]);
}
void addEdge(int f, int t) {
  to[ne] = t;
  nxt[ne] = head[f];
  head[f] = ne++;
}
void addBiEdge(int a, int b) {
  addEdge(a, b);
  addEdge(b, a);
}
long double ans;
void dfs(int u, int p, int dep) {
  ans += (1.0L / dep);
  for (int e = head[u]; ~e; e = nxt[e]) {
    int v = to[e];
    if (v == p) continue;
    dfs(v, u, dep + 1);
  }
}
int main() {
  scanf("%d", &n);
  init();
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    addBiEdge(--u, --v);
  }
  dfs(0, -1, 1);
  printf("%0.10Lf", ans);
}
