#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
double ans = 0.0;
vector<int> p[N];
void dfs(int x, int fa, int r) {
  ans += 1.0 / r;
  int len = p[x].size();
  for (int i = 0; i < len; i++) {
    if (p[x][i] != fa) {
      dfs(p[x][i], x, r + 1);
    }
  }
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    p[u].push_back(v);
    p[v].push_back(u);
  }
  dfs(1, 0, 1);
  printf("%.10lf", ans);
  return 0;
}
