#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const int maxn = 100000 + 10;
int n;
vector<int> v[maxn];
double ans;
void dfs(int x, int fa, int cnt) {
  ans += 1. / (cnt + 1.);
  for (int i = 0; i < ((int)(v[x]).size()); ++i) {
    int tmp = v[x][i];
    if (tmp == fa) continue;
    dfs(tmp, x, cnt + 1);
  }
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i <= n; ++i) v[i].clear();
    for (int i = 0; i < n - 1; ++i) {
      int x, y;
      scanf("%d%d", &x, &y);
      --x, --y;
      v[x].push_back(y);
      v[y].push_back(x);
    }
    ans = 0;
    dfs(0, -1, 0);
    printf("%.7lf\n", ans);
  }
  return 0;
}
