#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, x, y;
double sol;
vector<int> adj[maxn];
void dfs(int curr, int prev, int depth) {
  if (!depth)
    sol += 1.;
  else
    sol += 1. / double(depth);
  for (vector<int>::iterator it = adj[curr].begin(); it != adj[curr].end();
       it++)
    if (*it != prev) dfs(*it, curr, depth + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &x, &y);
    adj[x - 1].push_back(y - 1);
    adj[y - 1].push_back(x - 1);
  }
  dfs(0, -1, 1);
  printf("%.9lf\n", sol);
  return 0;
}
