#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const double pi = acos(-1.0);
const int size = 100 * 1000 + 100;
vector<int> vertex[size];
int n;
int deg[size];
double ans;
void dfs(int v, int fr, int d) {
  ans += 1.0 / d;
  for (int i = 0; i < vertex[v].size(); i++) {
    if (vertex[v][i] != fr) {
      dfs(vertex[v][i], v, d + 1);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    vertex[a].push_back(b);
    vertex[b].push_back(a);
  }
  ans = 0;
  dfs(0, 0, 1);
  cout.precision(20);
  cout << ans << endl;
  return 0;
}
