#include <bits/stdc++.h>
using namespace std;
int n, a, b;
vector<int> node[100010];
double ans = 0;
void fun(int fa, int a, int dp) {
  ans += 1.0 / dp;
  while (!node[a].empty()) {
    int b = node[a].back();
    node[a].pop_back();
    if (b == fa) continue;
    fun(a, b, dp + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &a, &b);
    node[a].push_back(b);
    node[b].push_back(a);
  }
  fun(0, 1, 1);
  printf("%.20f\n", ans);
  return 0;
}
