#include <bits/stdc++.h>
using namespace std;
vector<int> slo[100005];
int vis[100005];
int gleb[100005];
double wynik;
void dfs(int v, int g) {
  wynik += double(1) / g;
  vis[v] = 1;
  for (int i = 0; i < slo[v].size(); i++) {
    int aktv = slo[v][i];
    if (vis[aktv] == 0) {
      dfs(aktv, g + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    slo[a].push_back(b);
    slo[b].push_back(a);
  }
  dfs(1, 1);
  printf("%.7lf\n", wynik);
  return 0;
}
