#include <bits/stdc++.h>
using namespace std;
void IO() {
  srand(chrono::steady_clock::now().time_since_epoch().count());
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n;
vector<vector<int> > g;
vector<int> visited;
double ans = 0.0;
void dfs(int s, int d) {
  ans += (1.0 / (0.0 + d));
  visited[s] = 1;
  for (auto it : g[s]) {
    if (!visited[it]) {
      dfs(it, d + 1);
    }
  }
}
int main() {
  IO();
  cin >> n;
  g.resize(n);
  visited.resize(n, 0);
  int a, b;
  for (__typeof(n - 1) i = (0) - ((0) > (n - 1));
       i != (n - 1) - ((0) > (n - 1)); i += 1 - 2 * ((0) > (n - 1))) {
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, 1);
  cout << setprecision(19);
  cout << ans;
  return 0;
}
