#include <bits/stdc++.h>
using namespace std;
int i, n, x, y;
double rs;
vector<int> lda[100005];
void dfs(int x = 1, int tata = 1, int lvl = 1) {
  rs += 1.0 / lvl;
  for (auto it : lda[x]) {
    if (it == tata) continue;
    dfs(it, x, lvl + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (i = 1; i < n; ++i) {
    cin >> x >> y;
    lda[x].push_back(y);
    lda[y].push_back(x);
  }
  dfs();
  cout << setprecision(7) << fixed << rs << '\n';
  return 0;
}
