#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 3e5 + 5;
double ans;
int n, h[N], cnt, d[N];
struct Edge {
  int to, next;
} e[N << 1];
void add(int u, int v) {
  e[++cnt] = (Edge){v, h[u]};
  h[u] = cnt;
}
void Dfs(int u, int fa) {
  d[u] = d[fa] + 1;
  ans += 1.0 / d[u];
  for (int i = h[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    Dfs(v, u);
  }
}
int main() {
  cin >> n;
  for (register int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  Dfs(1, 0);
  printf("%.9f\n", ans);
}
