#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7, inf = 1e9;
int n;
int ehd[N], ev[N], enx[N], eid, dep[N];
double ns = 0;
void eadd(int u, int v) { ++eid, enx[eid] = ehd[u], ev[eid] = v, ehd[u] = eid; }
void dfs(int x, int fa) {
  ns += 1. / dep[x];
  for (int i = ehd[x]; i; i = enx[i])
    if (ev[i] != fa) dep[ev[i]] = dep[x] + 1, dfs(ev[i], x);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = (1); i <= (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    eadd(u, v), eadd(v, u);
  }
  dep[1] = 1, dfs(1, 0), cout.precision(12), cout << fixed, cout << ns << "\n";
  return 0;
}
