#include <bits/stdc++.h>
using namespace std;
int h[100011];
double bfs(const vector<vector<int> > &g) {
  queue<int> q;
  q.push(1);
  h[1] = 0;
  double ans = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      if (h[v] <= h[u] + 1) continue;
      h[v] = h[u] + 1;
      ans += 1.0 / (h[v] + 1);
      q.push(v);
    }
  }
  return ans;
}
int main() {
  int n;
  while (cin >> n) {
    memset(h, 1, sizeof(h));
    vector<vector<int> > g(n + 1);
    for (int i = 0; i < n - 1; i++) {
      int a, b;
      cin >> a >> b;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    printf("%.10lf\n", bfs(g) + 1);
  }
  return 0;
}
