#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
int n, m;
int head[maxn], dep[maxn], nxt[maxn], to[maxn], num;
void add(int a, int b) {
  to[++num] = b;
  nxt[num] = head[a];
  head[a] = num;
}
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int v = to[i];
    if (v == fa) continue;
    dfs(v, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += 1.0 / dep[i];
  }
  printf("%.6lf", ans);
  return 0;
}
