#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<int> h;
void dfs(int v, int p) {
  if (p != -1)
    h[v] = h[p] + 1;
  else
    h[v] = 1;
  for (int to : g[v]) {
    if (to != p) dfs(to, v);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  g.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  h.resize(n);
  dfs(0, -1);
  long double ans = 0;
  for (int x : h) {
    ans += 1. / x;
  }
  cout << fixed << setprecision(17) << ans << '\n';
  return 0;
}
