#include <bits/stdc++.h>
double dp[100111], ans;
int sz[100111], ds[100111];
std::list<int> edge[100111];
int i, j, n;
void dfs(int now, int fa) {
  ds[now] = ds[fa] + 1;
  ans += 1 / (double)ds[now];
  for (std::list<int>::const_iterator it(edge[now].begin());
       it != edge[now].end(); ++it)
    if (*it != fa) dfs(*it, now);
}
int main() {
  scanf("%d", &n);
  while (--n) {
    scanf("%d %d", &i, &j);
    edge[i].push_back(j);
    edge[j].push_back(i);
  }
  dfs(1, 0);
  printf("%.10lf\n", ans);
  return 0;
}
