#include <bits/stdc++.h>
using namespace std;
const int size = 1e5 + 5;
int h[size];
vector<int> g[size];
void dfs(int src, int par = -1) {
  if (par != -1)
    h[src] = h[par] + 1;
  else
    h[src] = 1;
  for (auto v : g[src]) {
    if (v == par) continue;
    dfs(v, src);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0, u, v; i < n - 1; i++)
    cin >> u >> v, g[u].push_back(v), g[v].push_back(u);
  dfs(1);
  long double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += (long double)(1.0 * 1) / h[i];
  }
  cout << setprecision(15) << fixed;
  cout << ans << "\n";
}
