#include <bits/stdc++.h>
const double pi = acos(-1.0);
using namespace std;
vector<int> G[100005];
int depth[100005];
void tag(int node, int s) {
  if (depth[node] < 0)
    depth[node] = s;
  else
    return;
  if (G[node].empty()) return;
  vector<int>::iterator it = G[node].begin();
  for (; it != G[node].end(); it++) {
    tag(*it, s + 1);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int f, e;
    cin >> f >> e;
    G[f].push_back(e);
    G[e].push_back(f);
  }
  memset(depth, -1, sizeof depth);
  tag(1, 1);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 1.0 / depth[i];
  }
  printf("%.7lf\n", ans);
}
