#include <bits/stdc++.h>
using namespace std;
vector<int> E[100010];
double sum;
int dep[100010];
void dfs(int u, int f) {
  dep[u] = dep[f] + 1;
  sum += 1.0 / dep[u];
  for (int i = 0; i < E[u].size(); i++) {
    if (E[u][i] != f) dfs(E[u][i], u);
  }
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    E[a].push_back(b);
    E[b].push_back(a);
  }
  dep[0] = 0;
  dfs(1, 0);
  printf("%.20lf\n", sum);
  return 0;
}
