#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
struct node {
  int to;
  int last;
} e[N << 1];
double dep[N];
int n;
int head[N];
int cnt;
double ans;
void add(int from, int to) {
  e[++cnt].last = head[from];
  e[cnt].to = to;
  head[from] = cnt;
}
void root(int u, int fa) {
  dep[u] = dep[fa] + 1;
  for (int i = head[u]; i; i = e[i].last) {
    int v = e[i].to;
    if (v == fa) continue;
    root(v, u);
  }
}
int main() {
  scanf("%d", &n);
  dep[1] = 1.0;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  root(1, 0);
  for (int i = 1; i <= n; i++) ans += (1 / dep[i]);
  printf("%.8lf\n", ans);
  return 0;
}
