#include <bits/stdc++.h>
std::vector<std::vector<int>> adj;
std::vector<bool> visit;
double recur(int cur, int depth) {
  double ret = 1.0 / depth;
  visit[cur] = true;
  for (auto it = adj[cur].begin(); it != adj[cur].end(); ++it) {
    if (visit[*it]) continue;
    ret += recur(*it, depth + 1);
  }
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  adj.resize(n);
  visit.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a;
    --b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  double answer = recur(0, 1);
  printf("%.7f\n", answer);
}
