#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> edge[100000];
double dfs(int v, int p = -1, int d = 1) {
  double ret = 1.0 / d;
  for (int i = 0; i < (int)(edge[v].size()); i++)
    if (edge[v][i] != p) ret += dfs(edge[v][i], v, d + 1);
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < (int)(n - 1); i++) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  double ret = dfs(0);
  printf("%.9lf\n", ret);
  return 0;
}
