#include <bits/stdc++.h>
using namespace std;
vector<int> edge[100005];
double sum;
void dfs(int p, int mom, int dep) {
  sum += 1.0 / dep;
  for (int i = 0; i < (int)((edge[p]).size()); i++)
    if (edge[p][i] != mom) dfs(edge[p][i], p, dep + 1);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  sum = 0.0;
  dfs(1, 0, 1);
  printf("%.7f\n", sum);
  return 0;
}
