#include <bits/stdc++.h>
using std::vector;
vector<vector<int>> e;
vector<int> g_depth;
void calcSub(int k, int p_depth) {
  int t = 0;
  for (int i = 0; i < e[k].size(); i++) {
    if (!g_depth[e[k][i]]) {
      g_depth[e[k][i]] = p_depth;
      calcSub(e[k][i], p_depth + 1);
    }
  }
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) {
    vector<int> ee;
    e.push_back(ee);
    g_depth.push_back(0);
  }
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  int root = 1;
  g_depth[root] = 1;
  calcSub(root, 2);
  long double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 1.0 / ((long double)g_depth[i]);
  }
  printf("%.9lf", ans);
  return 0;
}
