#include <bits/stdc++.h>
using namespace std;
void dfs(long long x, bool b[], vector<long long> adj[], long long depth[]) {
  b[x] = true;
  vector<long long>::iterator it;
  for (it = adj[x].begin(); it != adj[x].end(); it++) {
    if (!b[*it]) {
      depth[(*it)] = depth[x] + 1;
      dfs((*it), b, adj, depth);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> adj[n + 1];
  for (long long i = 1; i <= n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  bool b[n + 1];
  memset(b, 0, sizeof(b));
  long long depth[n + 1];
  depth[1] = 1;
  dfs(1, b, adj, depth);
  double res = 0.0;
  for (long long i = 1; i <= n; i++) {
    double temp = 1.0 / ((double)(depth[i]));
    res += temp;
  }
  printf("%0.9llf", res);
}
