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