#include <bits/stdc++.h>
using namespace std;
double ans = 1;
vector<int> g[100003];
void dfs(int idx, int fro, double d) {
  for (int i = 0; i < (int)(int)g[idx].size(); i++) {
    if (g[idx][i] == fro)
      continue;
    else {
      ans += 1 / d;
      dfs(g[idx][i], idx, d + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1, 0, 2);
  printf("%f", ans);
  return 0;
}
