#include <bits/stdc++.h>
const int INF_INT = 0x3f3f3f3f;
const long long INF_LL = 0x7f7f7f7f;
const int MOD = 1e9 + 7;
const double eps = 1e-10;
const double pi = acos(-1);
using namespace std;
vector<int> g[100010];
int n;
double ans;
void dfs(int fa, int u, int cnt) {
  ans += 1.0 / cnt;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == fa) continue;
    dfs(u, v, cnt + 1);
  }
}
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  ans = 0.0;
  dfs(0, 1, 1);
  printf("%.12f\n", ans);
  return 0;
}
