#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const long long linf = 1e18 + 5;
const int N = 1e5 + 5;
int n, x, y, a[N], dep[N];
vector<int> v[N];
double ans;
void dfs(int root, int x, int t) {
  ans += 1.0 / t;
  for (__typeof((v[x]).begin()) it = (v[x]).begin(); it != (v[x]).end(); it++)
    if (*it != root) dfs(x, *it, t + 1);
}
int main() {
  ios ::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(0, 1, 1);
  cout << fixed << setprecision(9) << ans << '\n';
  return 0;
}
