#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5;
vector<int> G[MAX_N + 5];
int d[MAX_N + 5];
int n;
void solve() {
  memset(d, 0, sizeof(d));
  d[1] = 1;
  queue<int> que;
  que.push(1);
  while (que.size() > 0) {
    int p = que.front();
    que.pop();
    for (int i = 0; i < G[p].size(); i++) {
      if (d[G[p][i]] > 0) continue;
      d[G[p][i]] = d[p] + 1;
      que.push(G[p][i]);
    }
  }
  double res = 0.0;
  for (int i = 1; i <= n; i++) res += 1 / double(d[i]);
  printf("%lf\n", res);
}
int main() {
  int a, b;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  solve();
  return 0;
}
