#include <bits/stdc++.h>
using namespace std;
void file(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
template <typename Tp>
void read(Tp &x) {
  int fh = 1;
  char c = getchar();
  x = 0;
  while (c > '9' || c < '0') {
    if (c == '-') {
      fh = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c & 15);
    c = getchar();
  }
  x *= fh;
}
int n;
int dep[1000005], h[1000005];
vector<int> G[1000005];
void dfs(int x, int pa) {
  dep[x] = dep[pa] + 1;
  h[dep[x]]++;
  for (auto y : G[x]) {
    if (y == pa) continue;
    dfs(y, x);
  }
}
double ans;
signed main() {
  read(n);
  for (int i = 1, u, v; i < n; ++i) {
    read(u);
    read(v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; ++i) ans = ans + 1.0 * h[i] / i;
  printf("%.10lf\n", ans);
  return 0;
}
