#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> adj[maxn];
long double ans = 0;
void dfs(int v = 0, int p = 0, long double d = 1) {
  ans += 1.0 / d;
  for (int u : adj[v]) {
    if (u == p) continue;
    dfs(u, v, d + 1.0);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs();
  cout << fixed << setprecision(12) << ans << endl;
}
