#include <bits/stdc++.h>
using namespace std;
vector<int> g[100003];
int dep[100003], n;
void dfs(int u, int last) {
  dep[u] = dep[last] + 1;
  for (int i = 0; i < int(g[u].size()); i++) {
    int v = g[u][i];
    if (v == last) continue;
    dfs(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += 1.0 / dep[i];
  printf("%.9lf\n", ans);
  return 0;
}
