#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
using namespace std;
vector<int> adj[MAXN];
double ans = 0.0;
void dfs(int u, int p, double d) {
  ans += 1. / d;
  for (int v : adj[u])
    if (v != p) dfs(v, u, d + 1);
}
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d", &(u)), scanf("%d", &(v));
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0, -1, 1);
  printf("%.15f\n", ans);
  return 0;
}
