#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char now[1 << 16], *S, *T;
  if (T == S) {
    T = (S = now) + fread(now, 1, 1 << 16, stdin);
    if (T == S) return EOF;
  }
  return *S++;
}
inline long long read() {
  register long long x = 0, f = 1;
  char ch = gc();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = gc();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = gc();
  }
  return (f == 1) ? x : -x;
}
struct edge {
  int to, nxt;
} g[1010101];
int dep[1010101], n, head[1010101], tot;
double ans;
inline void made(int from, int to) {
  g[++tot].to = to;
  g[tot].nxt = head[from];
  head[from] = tot;
}
void dfs(int u, int faa) {
  dep[u] = dep[faa] + 1;
  for (int i = head[u]; i; i = g[i].nxt) {
    int v = g[i].to;
    if (v == faa) continue;
    dfs(v, u);
  }
  ans += 1.0 / (1.0 * dep[u]);
}
signed main() {
  n = read();
  for (int i = 1; i < n; i++) {
    int x = read(), y = read();
    made(x, y);
    made(y, x);
  }
  dfs(1, 0);
  printf("%.10lf", ans);
  return 0;
}
