#include <bits/stdc++.h>
using namespace std;
vector<int> tree[100005];
int n;
double ans = 0;
void dfs(int x, int fa, int dep) {
  ans = ans + (double(1) / dep);
  for (int i = 0; i < tree[x].size(); i++) {
    if (fa != tree[x][i]) dfs(tree[x][i], x, dep + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int from, to;
    scanf("%d%d", &from, &to);
    tree[from].push_back(to);
    tree[to].push_back(from);
  }
  dfs(1, 0, 1);
  printf("%.20lf\n", ans);
  return 0;
}
