#include <bits/stdc++.h>
using namespace std;
double ans;
int n, x, y, i, depth[100005];
vector<int> q[100005];
void dfs(int x, int father) {
  depth[x] = depth[father] + 1;
  for (auto v : q[x]) {
    if (v == father) continue;
    dfs(v, x);
  }
}
int main() {
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    q[x].push_back(y);
    q[y].push_back(x);
  }
  dfs(1, 0);
  for (i = 1; i <= n; i++) {
    ans += 1 / (depth[i] * 1.0);
  }
  printf("%.20lf", ans);
  return 0;
}
