#include <bits/stdc++.h>
using namespace std;
const long long sz = 2e5 + 5, mod = 1e9 + 7;
long long t, n, m, k, q;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    cin >> n;
    vector<vector<long long> > gr(n + 1);
    for (long long i = 1; i < n; i++) {
      long long u, v;
      cin >> u >> v;
      gr[u].push_back(v);
      gr[v].push_back(u);
    }
    vector<bool> vis(n + 1, 0);
    queue<pair<long long, double> > Q;
    double ans = 0;
    Q.push({1, 1});
    vis[1] = 1;
    while (!Q.empty()) {
      auto it = Q.front();
      Q.pop();
      ans += 1.0 / it.second;
      for (auto i : gr[it.first]) {
        if (!vis[i]) {
          Q.push({i, it.second + 1});
          vis[i] = 1;
        }
      }
    }
    cout << fixed << setprecision(10) << ans << "\n";
  }
  return 0;
}
