#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
vector<int> g[N];
double tot = 0;
void dfs(int u, int pre, int w) {
  tot += (double)1.0 / (double)w;
  for (int i = 0; i < g[u].size(); ++i) {
    int v = g[u][i];
    if (v == pre) continue;
    dfs(v, u, w + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0, 1);
  cout << fixed << setprecision(10) << tot << '\n';
  return 0;
}
