#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int INF = 1e9;
int n;
vector<int> G[maxn];
double dfs(int u, int pre, int dep) {
  double ret = 1.0 / dep;
  for (int i = 0; i < (int)G[u].size(); i++) {
    int v = G[u][i];
    if (v == pre) continue;
    ret += dfs(v, u, dep + 1);
  }
  return ret;
}
int main() {
  int a, b;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) G[i].clear();
    for (int i = 0; i < n - 1; i++) {
      scanf("%d%d", &a, &b);
      G[a].push_back(b);
      G[b].push_back(a);
    }
    printf("%.6f\n", dfs(1, -1, 1));
  }
  return 0;
}
