#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
vector<int> e[MAXN];
int dep[MAXN];
void dfs(int u, int d) {
  dep[u] = d;
  for (auto& v : e[u])
    if (!dep[v]) {
      dfs(v, d + 1);
    }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1, u, v; i < n; ++i) {
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 1);
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans += 1.0 / dep[i];
  printf("%.10lf", ans);
  return 0;
}
