#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> graf[111111];
  int i, j, n, a, b, v, to;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    graf[a].push_back(b);
    graf[b].push_back(a);
  }
  vector<int> d(n + 1);
  vector<bool> used(n + 1, false);
  d[1] = 0;
  deque<int> q;
  q.push_front(1);
  while (q.size()) {
    v = q.front();
    used[v] = true;
    q.pop_front();
    for (i = 0; i < graf[v].size(); i++) {
      to = graf[v][i];
      if (!used[to]) {
        q.push_back(to);
        d[to] = d[v] + 1;
      }
    }
  }
  int depth = -1;
  for (i = 1; i <= n; i++) depth = max(depth, d[i]);
  depth++;
  vector<int> kol(depth + 1);
  vector<long double> dp(depth + 1), sum(depth + 1);
  dp[1] = sum[1] = 1.0;
  for (i = 2; i <= depth; i++) {
    dp[i] = 1 + sum[i - 1] / i;
    sum[i] = sum[i - 1] + dp[i];
  }
  long double ans = dp[depth];
  for (i = 1; i <= n; i++) kol[d[i]]++;
  for (i = 1; i < depth; i++) ans += ((long double)kol[i] - 1) / (i + 1);
  cout.precision(15);
  cout << fixed << ans;
  return 0;
}
