#include <bits/stdc++.h>
using namespace std;
vector<int> V[100006];
bool vis[100006];
int level[100006];
void dfs(int idx, int l) {
  int sz;
  level[idx] = l;
  vis[idx] = 1;
  sz = V[idx].size();
  for (int i = 0; i < sz; i++)
    if (!vis[V[idx][i]]) dfs(V[idx][i], l + 1);
}
int main() {
  int n, x, y;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    V[x].push_back(y);
    V[y].push_back(x);
  }
  memset(level, -1, sizeof level);
  memset(vis, 0, sizeof vis);
  dfs(1, 0);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += (1.0 / (level[i] + 1));
  }
  printf("%.18lf\n", ans);
  return 0;
}
