#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, deep[N];
double ans;
vector<int> v[N];
void dfs(int fa, int u) {
  deep[u] = deep[fa] + 1;
  ans += 1 / (double)deep[u];
  for (int i = 0; i < v[u].size(); i++) {
    int to = v[u][i];
    if (to == fa) continue;
    dfs(u, to);
  }
}
int main() {
  int x, y;
  while (~scanf("%d", &n)) {
    ans = 0;
    for (int i = 1; i <= n; i++) v[i].clear();
    for (int i = 1; i < n; i++) {
      scanf("%d%d", &x, &y);
      v[x].push_back(y);
      v[y].push_back(x);
    }
    dfs(0, 1);
    printf("%.10f\n", ans);
  }
  return 0;
}
