#include <bits/stdc++.h>
struct rec {
  int next, y;
};
rec mp[200001];
int idx[100001];
int f[100001];
double ans;
int l, i, n, x, y;
int getint() {
  char ch;
  int x;
  ch = getchar();
  while ((ch < '0') || (ch > '9')) {
    ch = getchar();
  }
  x = 0;
  while ((ch >= '0') && (ch <= '9')) {
    x *= 10;
    x += ch - '0';
    ch = getchar();
  }
  return x;
}
void addedge(int x, int y) {
  l++;
  mp[l].y = y;
  mp[l].next = idx[x];
  idx[x] = l;
  l++;
  mp[l].y = x;
  mp[l].next = idx[y];
  idx[y] = l;
}
void dfs(int x, int dep) {
  int i;
  f[x] = 1;
  ans += 1.0 / dep;
  for (i = idx[x]; i; i = mp[i].next) {
    if (f[mp[i].y]) {
      continue;
    }
    dfs(mp[i].y, dep + 1);
  }
}
int main() {
  n = getint();
  l = 1;
  memset(mp, 0, sizeof(mp));
  for (i = 1; i < n; i++) {
    x = getint();
    y = getint();
    addedge(x, y);
  }
  memset(f, 0, sizeof(f));
  ans = 0;
  dfs(1, 1);
  printf("%.8lf\n", ans);
  return 0;
}
