#include <bits/stdc++.h>
using namespace std;
template <typename tn>
void read(tn &a) {
  tn x = 0, f = 1;
  char c = ' ';
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  a = x * f;
}
const int N = 1e5 + 5;
int n;
struct Edge {
  int next, to;
} e[N * 2];
int head[N], cnt;
int d[N];
void add(int x, int y) {
  e[++cnt].next = head[x];
  e[cnt].to = y;
  head[x] = cnt;
}
queue<int> q;
double ans;
int main() {
  read(n);
  int a, b;
  for (int i = 1; i < n; i++) {
    read(a);
    read(b);
    add(a, b);
    add(b, a);
  }
  d[1] = 1;
  q.push(1);
  while (q.size()) {
    int x = q.front();
    ans += 1.0 / d[x];
    q.pop();
    for (int i = head[x]; i; i = e[i].next)
      if (!d[e[i].to]) {
        d[e[i].to] = d[x] + 1;
        q.push(e[i].to);
      }
  }
  printf("%.20f\n", ans);
  return 0;
}
