#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
vector<int> tree[maxn];
double p[maxn];
int h[maxn];
bool used[maxn];
void bfs() {
  queue<int> q;
  q.push(1);
  used[1] = 1;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < tree[v].size(); ++i) {
      if (!used[tree[v][i]]) {
        used[tree[v][i]] = 1;
        q.push(tree[v][i]);
        h[tree[v][i]] = h[v] + 1;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  h[1] = 1;
  bfs();
  for (int i = 1; i <= n; ++i) {
    p[i] = 1.0 / h[i];
  }
  auto m = accumulate(p + 1, p + n + 1, 0.0);
  cout << setprecision(6) << fixed << m << endl;
}
