#include <bits/stdc++.h>
using namespace std;
const int M = 100010;
int n, head[M], tot, dep[M];
bool vis[M];
struct edge {
  int t, next;
} e[M * 2];
queue<int> q;
void add(int f, int t) {
  e[tot].t = t;
  e[tot].next = head[f];
  head[f] = tot++;
}
int main() {
  int a, b;
  scanf("%d", &n);
  memset(head, -1, sizeof(head));
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &a, &b);
    add(a, b);
    add(b, a);
  }
  q.push(1);
  int now = 1;
  dep[1] = 1;
  vis[1] = 1;
  while (!q.empty()) {
    now = q.front();
    q.pop();
    for (int i = head[now]; i != -1; i = e[i].next) {
      if (!vis[e[i].t]) {
        q.push(e[i].t);
        dep[e[i].t] = dep[now] + 1;
        vis[e[i].t] = 1;
      }
    }
  }
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 1 / (double)dep[i];
  }
  cout << fixed << setprecision(20) << ans << endl;
  return 0;
}
