#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
int dep[N];
vector<int> G[N];
double ans;
void addedge(int u, int v) { G[u].push_back(v); }
void dfs(int u, int fa) {
  for (int v, i = 0; i < (int)G[u].size(); i++) {
    v = G[u][i];
    if (v == fa) {
      continue;
    }
    dep[v] = dep[u] + 1;
    dfs(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    addedge(u, v);
    addedge(v, u);
  }
  dep[1] = 1;
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    ans += 1.0 / dep[i];
  }
  printf("%.20lf\n", ans);
  return 0;
}
