#include <bits/stdc++.h>
using namespace std;
int n, ad[100005];
vector<int> v[100005];
long double ex;
void dfs(int nod, int tata) {
  ad[nod] = 1 + ad[tata];
  for (auto it = v[nod].begin(); it != v[nod].end(); ++it)
    if (*it != tata) dfs(*it, nod);
}
int main() {
  int i, x, y;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, 0);
  for (i = 1; i <= n; i++) ex += (1.0 / ((long double)ad[i]));
  cout << fixed << setprecision(10) << ex;
  return 0;
}
