#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
vector<int> graph[N];
int n;
double ans = 0;
void dfs(int u, int p, int level) {
  for (int v : graph[u]) {
    if (v != p) {
      dfs(v, u, level + 1);
    }
  }
  ans += (double)(1.0 / level);
}
int main() {
  std ::ios ::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    graph[x].emplace_back(y);
    graph[y].emplace_back(x);
  }
  dfs(1, -1, 1);
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
