#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n;
vector<int> g[MAXN];
int d[MAXN];
int bio[MAXN];
void dfs(int x, int dep) {
  d[x] = dep;
  bio[x] = 1;
  for (int i : g[x])
    if (!bio[i]) dfs(i, dep + 1);
}
int main() {
  scanf("%d", &n);
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, 1);
  double rj = 0;
  for (int i = 0; i < n; i++) {
    rj += 1.0 / d[i];
  }
  printf("%lf\n", rj);
  return 0;
}
