#include <bits/stdc++.h>
using namespace std;
long long int dep[100010];
vector<long long int> gph[100001];
void dfs(long long int u, long long int par) {
  for (auto &it : gph[u]) {
    if (it != par) dep[it] = dep[u] + 1, dfs(it, u);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n - 1; i++) {
    long long int u, v;
    cin >> u >> v;
    gph[u].push_back(v);
    gph[v].push_back(u);
  }
  dep[1] = 1;
  dfs(1, 1);
  long double ans = 0;
  for (long long int i = 1; i <= n; i++) {
    ans += 1.0 / dep[i];
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
