#include <bits/stdc++.h>
using namespace std;
struct ed {
  int u, nex;
} e[500001 * 2];
int n, a, b, d[500001], st, fir[500001];
double ans;
void add(int x, int y) {
  e[++st] = (ed){y, fir[x]};
  fir[x] = st;
  e[++st] = (ed){x, fir[y]};
  fir[y] = st;
}
void dfs(int x, int fa) {
  d[x] = d[fa] + 1;
  ans += 1.0 / d[x];
  for (int i = fir[x]; i; i = e[i].nex) {
    int u = e[i].u;
    if (u == fa) continue;
    dfs(u, x);
  }
}
int main() {
  cin >> n;
  for (int i = 1, x, y; i < n; i++) cin >> x >> y, add(x, y);
  dfs(1, 0);
  printf("%.7lf", ans);
  return 0;
}
