#include <bits/stdc++.h>
using namespace std;
long long n, tot, deep[1000001], ver[1000001], nex[1000001], head[1000001];
double ans;
void add(long long x, long long y) {
  ver[++tot] = y;
  nex[tot] = head[x];
  head[x] = tot;
}
void dfs(long long x, long long fa) {
  deep[x] = deep[fa] + 1;
  for (long long i = head[x]; i; i = nex[i]) {
    long long y = ver[i];
    if (y == fa) continue;
    dfs(y, x);
  }
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n - 1; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1, 0);
  for (long long i = 1; i <= n; i++) {
    ans += 1.0 / deep[i];
  }
  printf("%.20f\n", ans);
  return 0;
}
