#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int n;
vector<int> adj[MAX];
double dfs(int source, int father, int depth = 1) {
  double total = 1.0 / (double)depth;
  for (auto &each : adj[source]) {
    if (each != father) {
      total += dfs(each, source, depth + 1);
    }
  }
  return total;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = int(0); i < int(n - 1); i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cout << fixed << setprecision(15) << dfs(1, -1) << '\n';
  return 0;
}
