#include <bits/stdc++.h>
using namespace std;
vector<int> G[100001];
double ans = 0;
void dfs(int s, int pa, int d) {
  ans += (double)(1.0 / d);
  vector<int>::iterator pos;
  for (pos = G[s].begin(); pos != G[s].end(); ++pos) {
    if (*pos != pa) dfs(*pos, s, d + 1);
  }
}
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, -1, 1);
  printf("%.7lf\n", ans);
  return 0;
}
