#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> gp[N];
int lev[N];
int n;
void dfs(int node, int parent) {
  for (auto it : gp[node]) {
    if (it == parent) continue;
    lev[it] = lev[node] + 1;
    dfs(it, node);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    gp[u].push_back(v);
    gp[v].push_back(u);
  }
  lev[1] = 1;
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += (1.0 / (lev[i] * 1.0));
  }
  printf("%.14lf\n", ans);
  return 0;
}
