#include <bits/stdc++.h>
using namespace std;
long usd[300000], d[300000];
double ans;
vector<long> g[300000];
long a, b, n;
void dfs(long v) {
  usd[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    long q = g[v][i];
    if (usd[q]) continue;
    d[q] = d[v] + 1;
    dfs(q);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) ans += 1.0 / (d[i] + 1);
  cout.precision(8);
  cout << fixed << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
