#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int n, de[N];
int tot, first[N], nxt[N * 2], point[N * 2];
double ans;
void add_edge(int x, int y) {
  tot++;
  nxt[tot] = first[x];
  first[x] = tot;
  point[tot] = y;
}
void dfs(int x, int fa) {
  ans += 1.0 / (de[x] * 1.0);
  for (int i = first[x]; i != -1; i = nxt[i]) {
    int u = point[i];
    if (u == fa) continue;
    de[u] = de[x] + 1;
    dfs(u, x);
  }
}
int main() {
  tot = -1;
  memset(first, -1, sizeof(first));
  memset(nxt, -1, sizeof(nxt));
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add_edge(u, v);
    add_edge(v, u);
  }
  de[1] = 1;
  dfs(1, 1);
  printf("%.8lf\n", ans);
}
