#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n;
double ans;
bool mark[N];
vector<int> adl[N];
void dfs(int v, int l) {
  ans += 1. / l;
  mark[v] = 1;
  for (int i = 0; i < adl[v].size(); ++i)
    if (!mark[adl[v][i]]) dfs(adl[v][i], l + 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1, x, y; i < n; ++i) {
    cin >> x >> y;
    adl[x].push_back(y);
    adl[y].push_back(x);
  }
  dfs(1, 1);
  cout << setprecision(7) << fixed;
  cout << ans << endl;
  return 0;
}
