#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000;
vector<int> adj[N];
int h[N] = {0, 1};
short mrk[N] = {0, 1};
double ans;
void dfs(int v) {
  ans += (long double)1 / h[v];
  for (int i = 0; i < (int)(adj[v]).size(); ++i)
    if (!mrk[adj[v][i]]++) h[adj[v][i]] = h[v] + 1, dfs(adj[v][i]);
}
int main() {
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  int n, a, b;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1);
  cout << ans << endl;
  return 0;
}
