#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int from, to;
  Edge(int f, int t) : from(f), to(t) {}
};
vector<Edge> edges;
vector<int> G[100005];
int h[100005];
void add_edge(int from, int to) {
  edges.push_back(Edge(from, to));
  int m = edges.size();
  G[from].push_back(m - 1);
  return;
}
void dfs(int x, int high) {
  if (h[x]) return;
  if (!h[x]) h[x] = high;
  for (int i = 0; i < G[x].size(); i++) {
    Edge &e = edges[G[x][i]];
    dfs(e.to, high + 1);
  }
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      scanf("%d %d", &u, &v);
      add_edge(u, v);
      add_edge(v, u);
    }
    memset(h, 0, sizeof(h));
    dfs(1, 1);
    double sum = 0.0;
    for (int i = 1; i <= n; i++) {
      if (h[i] != 0) sum += (double)1 / h[i];
    }
    printf("%lf\n", sum);
  }
  return 0;
}
