#include <bits/stdc++.h>
using namespace std;
struct Node {
  int v;
  Node *next;
} * edge[101010], space[101010 << 1];
int C = 0;
double ans;
void addedge(int x, int y) {
  Node *p = &space[C++];
  p->v = x;
  p->next = edge[y];
  edge[y] = p;
  p = &space[C++];
  p->v = y;
  p->next = edge[x];
  edge[x] = p;
}
void dfs(int x, int fa, int dep) {
  ans += 1.0 / dep;
  for (Node *p = edge[x]; p; p = p->next) {
    if (p->v == fa) continue;
    dfs(p->v, x, dep + 1);
  }
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) edge[i] = NULL;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    addedge(a, b);
  }
  ans = 0.0;
  dfs(1, 0, 1);
  printf("%.7f\n", ans);
  return 0;
}
