#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
vector<int> e[N];
double ans;
void dfs(int v = 0, int p = -1, int h = 1) {
  ans += (double)1 / h;
  for (int to : e[v])
    if (to != p) {
      dfs(to, v, h + 1);
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs();
  printf("%.9lf", ans);
  return 0;
}
