#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1e2;
vector<int> G[MAX];
double dfs(int u, int p, int h = 1) {
  double e = 1.0 / h;
  for (int v : G[u])
    if (v != p) e += dfs(v, u, h + 1);
  return e;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n - 1); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  printf("%.10f\n", dfs(1, 0));
  return 0;
}
