#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1;
struct p {
  int x, y;
} c[MAX << 1];
int n, num, s;
double ans;
int h[MAX];
void add(int x, int y) {
  c[++num] = (p){h[x], y}, h[x] = num;
  c[++num] = (p){h[y], x}, h[y] = num;
}
void dfs(int f, int x, double d) {
  ans += 1 / (d + 1);
  for (int i = h[x]; i; i = c[i].x)
    if (f != c[i].y) dfs(x, c[i].y, d + 1);
}
int main() {
  scanf("%d", &n);
  for (int x, y, i = 1; i < n; ++i) scanf("%d%d", &x, &y), add(x, y);
  dfs(0, 1, 0);
  printf("%.7lf", ans);
  return 0;
}
