#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100010;
int N, A, B;
double Ans;
vector<int> G[NMAX];
void DFS(int Node, int Father, int Level) {
  Ans += 1.0 / Level;
  for (int i = 0; i < G[Node].size(); ++i)
    if (G[Node][i] != Father) DFS(G[Node][i], Node, Level + 1);
}
int main() {
  scanf("%i", &N);
  for (int i = 1; i < N; ++i) {
    scanf("%i %i", &A, &B);
    G[A].push_back(B);
    G[B].push_back(A);
  }
  DFS(1, 0, 1);
  printf("%.10lf", Ans);
}
