#include <bits/stdc++.h>
using namespace std;
int n, v[110000];
vector<int> e[101000];
double z = 0.0;
void dfs(int x, int d) {
  z += 1.0 / d;
  v[x] = 1;
  for (int i = 0, j = e[x].size(); i < j; i++) {
    if (!v[e[x][i]]) dfs(e[x][i], d + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1, 1);
  printf("%.8lf", z);
}
