#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
inline int read() {
  int x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x;
}
struct edge {
  int to, next;
} e[N << 1];
int head[N], cnt;
inline void add(int u, int v) {
  e[++cnt] = (edge){v, head[u]};
  head[u] = cnt;
}
int dep[N], n;
double ans;
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs(v, x);
  }
}
int main() {
  n = read();
  int u, v;
  for (int i = 1; i < n; ++i) {
    u = read();
    v = read();
    add(u, v);
    add(v, u);
  }
  dfs(1, 1);
  for (int i = 1; i <= n; ++i) ans += (1.0 / dep[i]);
  printf("%.9lf", ans);
}
