#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
const int INF = 1e9 + 7;
vector<int> adj[N];
double ans;
void dfs(int cur, int fat, int depth) {
  ans += 1. / depth;
  for (int nxt : adj[cur]) {
    if (nxt == fat) continue;
    dfs(nxt, cur, depth + 1);
  }
}
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0, 1);
  printf("%.6f", ans);
  return 0;
}
