#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
struct edge {
  int to, next;
  edge(int t = 0, int n = 0) : to(t), next(n) {}
} e[N << 1];
int n, tot, head[N], deep[N];
double ans = 0;
inline void inittree() { tot = 0, memset(head, 0, sizeof(head)), deep[0] = 0; }
inline void addedge(int x, int y) {
  e[++tot] = edge(y, head[x]), head[x] = tot;
}
inline void dfs(int x, int fa = 0) {
  deep[x] = deep[fa] + 1;
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa) dfs(e[i].to, x);
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++)
    scanf("%d%d", &x, &y), addedge(x, y), addedge(y, x);
  dfs(1);
  for (int i = 1; i <= n; i++) ans += 1.0 / deep[i];
  printf("%.10lf\n", ans);
  return 0;
}
