#include <bits/stdc++.h>
using namespace std;
vector<int> G[100005];
int n;
int dep[100005];
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == fa)
      continue;
    else
      dfs(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += 1.0 / dep[i];
  printf("%.8f", ans);
  return 0;
}
