#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
vector<int> graf[MAXN];
int n;
double rj;
void dfs(int cvor, int roditelj, int dubina) {
  rj += 1.0 / dubina;
  for (int i = 0; i < graf[cvor].size(); i++)
    if (graf[cvor][i] != roditelj) dfs(graf[cvor][i], cvor, dubina + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    graf[a].push_back(b);
    graf[b].push_back(a);
  }
  dfs(1, -1, 1);
  printf("%.9lf\n", rj);
  return 0;
}
