#include <bits/stdc++.h>
using namespace std;
const double eps(1e-8);
int n;
double ans;
vector<int> v[110000];
void dfs(int i, int f, int depth) {
  ans += 1.0 / depth;
  for (int j = 0; j < (v[i].size()); ++j) {
    if (v[i][j] == f) continue;
    dfs(v[i][j], i, depth + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  ans = 0;
  dfs(1, 0, 1);
  printf("%.10lf\n", ans);
}
