#include <bits/stdc++.h>
using namespace std;
int arr[100100];
vector<int> v[100100];
void bfs(int src) {
  int i, j;
  j = v[src].size();
  for (i = 0; i < j; i++) {
    if (!arr[v[src][i]]) {
      arr[v[src][i]] = arr[src] + 1;
      bfs(v[src][i]);
    }
  }
}
int main() {
  int n, a, b, i, j, k;
  cin >> n;
  arr[1] = 1;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  bfs(1);
  double ans = 0;
  for (i = 1; i <= n; i++) {
    ans += (double)1 / arr[i];
  }
  printf("%.14f\n", ans);
  return 0;
}
