#include <bits/stdc++.h>
using namespace std;
struct node {
  int to, next;
} edge[200010];
int a, b, lastshow[100005], cnt = 0, v[100005], que[300005], n;
double ans = 0.0;
bool use[100005];
void insert(int a, int b) {
  edge[cnt].to = b;
  edge[cnt].next = lastshow[a];
  lastshow[a] = cnt++;
}
void bfs() {
  int head = 0, tail = 0;
  que[tail++] = 1;
  v[1] = 1;
  use[1] = true;
  while (head < tail) {
    int cur = que[head++];
    int id = lastshow[cur];
    while (id != -1) {
      int now = edge[id].to;
      if (!use[now]) {
        v[now] = v[cur] + 1;
        que[tail++] = now;
        use[now] = true;
      }
      id = edge[id].next;
    }
  }
}
int main() {
  while (scanf("%d", &n) != EOF) {
    int size = n;
    ans = 0.0;
    cnt = 0;
    memset(lastshow, -1, sizeof(lastshow));
    memset(edge, 0, sizeof(edge));
    memset(v, 0, sizeof(v));
    memset(use, false, sizeof(use));
    while (size--) {
      scanf("%d%d", &a, &b);
      insert(a, b);
      insert(b, a);
      if (size == 1) break;
    }
    bfs();
    for (int i = 1; i <= n; i++) {
      if (v[i]) ans += 1.0 / v[i];
    }
    printf("%.8lf\n", ans);
  }
  return 0;
}
