#include <bits/stdc++.h>
using namespace std;
const long long sz = 1e5 + 10;
vector<long long> g[sz];
double ans = 0;
void dfs(long long u, long long p, long long lev) {
  ans += ((double)1 / lev);
  for (long long &v : g[u])
    if (v != p) dfs(v, u, lev + 1);
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    scanf("%lld", &u), scanf("%lld", &v);
    g[u].push_back(v), g[v].push_back(u);
  }
  dfs(1, -1, 1);
  printf("%0.6f\n", ans);
  return 0;
}
