#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int maxn = 1e5 + 10;
vector<int> g[maxn];
int dep[maxn];
int vis[maxn];
void dfs(int fa, int h) {
  vis[fa] = 1;
  for (int i = 0; i < g[fa].size(); i++) {
    if (vis[g[fa][i]] == 0) {
      dep[g[fa][i]] = h + 1;
      dfs(g[fa][i], h + 1);
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dep[1] = 1;
  dfs(1, 1);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 1 / (dep[i] * 1.0);
  }
  cout << setiosflags(ios::fixed) << setprecision(8) << ans << endl;
  return 0;
}
