#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int ecnt, hea[maxn], to[maxn * 2], nex[maxn * 2];
void add(int u, int v) {
  to[++ecnt] = v, nex[ecnt] = hea[u], hea[u] = ecnt;
  to[++ecnt] = u, nex[ecnt] = hea[v], hea[v] = ecnt;
}
double ans;
void dfs(int u, int up, double h) {
  ans += 1.0 / h;
  for (int i = hea[u]; i != -1; i = nex[i]) {
    int v = to[i];
    if (v == up) continue;
    dfs(v, u, h + 1);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  ecnt = -1;
  memset(hea, -1, sizeof(hea));
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
  }
  dfs(1, 1, 1);
  printf("%.9lf", ans);
  return 0;
}
