#include <bits/stdc++.h>
using namespace std;
int n;
int head[100005], val[200005], nex[200005], ind;
double ans;
void dfs(int cur, int depth, int fa) {
  ans += ((double)1 / depth);
  for (int j, i = head[cur]; ~i; i = nex[i]) {
    j = val[i];
    if (j == fa) continue;
    dfs(j, depth + 1, cur);
  }
}
int main() {
  scanf("%d", &n);
  memset(head, -1, sizeof(head));
  ind = 0;
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    val[ind] = b, nex[ind] = head[a], head[a] = ind++;
    val[ind] = a, nex[ind] = head[b], head[b] = ind++;
  }
  ans = 0.0;
  dfs(1, 1, -1);
  printf("%.20f", ans);
  return 0;
}
