#include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp& x) {
  x = 0;
  register long long f = 1;
  register char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  x *= f;
}
template <typename Tp>
inline void print(Tp x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 1e6;
double dep[maxn];
int n;
int tot;
int head[maxn];
struct qwq {
  int to;
  int next;
} s[maxn];
inline void add(int x, int y) {
  s[++tot].to = y;
  s[tot].next = head[x];
  head[x] = tot;
  return;
}
inline void dfs(int x, int fa, double depth) {
  dep[x] = depth;
  for (register long long i = head[x]; i; i = s[i].next) {
    int v = s[i].to;
    if (v == fa) continue;
    dfs(v, x, depth + 1);
  }
  return;
}
int main() {
  read(n);
  for (register long long i = 1; i < n; ++i) {
    int x, y;
    read(x), read(y);
    add(x, y), add(y, x);
  }
  dfs(1, 0, 1);
  double ans = 0;
  for (register long long i = 1; i <= n; ++i) ans += 1.0 / dep[i];
  printf("%.10lf", ans);
  return 0;
}
