#include <bits/stdc++.h>
using namespace std;
int n, num, first[100005], nex[200005], to[200005], dep[100005];
double ans;
inline void add(int u, int v) {
  to[++num] = v;
  nex[num] = first[u];
  first[u] = num;
}
void dfs(int u, int dad) {
  dep[u] = dep[dad] + 1;
  for (int i = first[u]; i; i = nex[i])
    if (to[i] != dad) dfs(to[i], u);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v), add(v, u);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) ans += (double)1 / dep[i];
  printf("%.7f", ans);
  return 0;
}
