#include <bits/stdc++.h>
using namespace std;
int mark[100009];
vector<int> graph[100009];
int N;
double ans;
double bfs() {
  queue<int> Q;
  Q.push(1);
  int now, level = 1;
  mark[1] = 1;
  ans = 1;
  while (!Q.empty()) {
    now = Q.front();
    Q.pop();
    level = mark[now];
    for (auto it : graph[now]) {
      if (!mark[it]) {
        mark[it] = mark[now] + 1;
        Q.push(it);
        ans += (1 / (double)mark[it]);
      }
    }
  }
  return ans;
}
int main() {
  int x, y;
  cin >> N;
  for (int i = 1; i < N; i++) {
    scanf("%d%d", &x, &y);
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  printf("%.7lf", bfs());
  return 0;
}
