#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000 + 10;
int n, num[MAX];
vector<int> ne[MAX];
void dfs(int u, int fa) {
  int i, v;
  num[u]++;
  for ((i) = (0); (i) != (ne[u].size()); ++(i)) {
    v = ne[u][i];
    if (v == fa) continue;
    num[v] = num[u];
    dfs(v, u);
  }
}
int main() {
  int i, a, b;
  scanf("%d", &n);
  for ((i) = (1); (i) <= (n - 1); ++(i)) {
    scanf("%d%d", &a, &b);
    ne[a].push_back(b);
    ne[b].push_back(a);
  }
  dfs(1, 0);
  double ans = 0;
  for ((i) = (1); (i) <= (n); ++(i)) ans += 1.0 / num[i];
  printf("%lf\n", ans);
  return 0;
}
