#include <bits/stdc++.h>
using namespace std;
int n;
double ans = 0;
vector<int> G[100010];
void dfs(int p, int f, int l) {
  ans += 1. / l;
  for (__typeof((G[p]).begin()) it = (G[p]).begin(); it != (G[p]).end(); it++) {
    if (*it == f) continue;
    dfs(*it, p, l + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, 0, 1);
  printf("%.20lf\n", ans);
}
