#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
template <class T>
bool cmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool cmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
struct starter {
  high_resolution_clock::time_point t1, t2;
  starter() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    t1 = high_resolution_clock::now();
  }
  ~starter() {
    t2 = high_resolution_clock::now();
    duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
    cerr << "It took " << time_span.count() << " seconds.";
  }
} starter_;
const int64_t inf = 1e18;
const int64_t N = 5e5 + 5;
void solve() {
  int64_t n;
  cin >> n;
  vector<vector<int64_t>> g(n + 1);
  vector<int64_t> depth(n + 1);
  vector<int64_t> vis(n + 1);
  for (int64_t i = (0); i < (n - 1); ++i) {
    int64_t u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  depth[1] = 1;
  queue<int64_t> Q;
  Q.push(1);
  while ((int64_t)(Q.size())) {
    int64_t u = Q.front();
    Q.pop();
    vis[u] = 1;
    for (int64_t v : g[u]) {
      if (!vis[v]) {
        depth[v] = depth[u] + 1;
        Q.push(v);
      }
    }
  }
  double ans = 0;
  for (int64_t i = (1); i <= (n); ++i) ans += 1. / depth[i];
  printf("%0.12f\n", ans);
}
int32_t main() { solve(); }
