#include <bits/stdc++.h>
using namespace std;
struct node {
  int next, to;
} a[200005];
int n, cnt, head[100005], dep[100005];
double ans;
void add(int x, int y) {
  a[++cnt].next = head[x];
  a[cnt].to = y;
  head[x] = cnt;
}
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (y == fa) continue;
    dfs(y, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dep[1] = 1;
  dfs(1, 0);
  for (int i = 1; i <= n; i++) ans = ans + (1.0) / dep[i];
  printf("%.6lf", ans);
  return 0;
}
