#include <bits/stdc++.h>
using namespace std;
template <class T, class L>
bool smax(T &x, L y) {
  return x < y ? (x = y, 1) : 0;
}
template <class T, class L>
bool smin(T &x, L y) {
  return y < x ? (x = y, 1) : 0;
}
const int maxn = 1e5 + 17;
int n;
vector<int> g[maxn];
double ans;
void dfs(int v = 0, int hi = 1, int p = -1) {
  ans += 1. / hi;
  for (auto u : g[v])
    if (u != p) dfs(u, hi + 1, v);
}
int main() {
  cin >> n;
  for (int i = 1, v, u; i < n; i++)
    cin >> v >> u, g[--v].push_back(--u), g[u].push_back(v);
  dfs();
  cout << fixed << setprecision(17) << ans << '\n';
  return 0;
}
