#include <bits/stdc++.h>
using namespace std;
int n, x, y;
double sol = 0.0;
struct Node {
  vector<int> adj;
};
Node graf[100001];
bool mark[100001];
inline void DFS() {
  stack<int> dfs_stek;
  stack<int> depth;
  dfs_stek.push(1);
  depth.push(1);
  while (!dfs_stek.empty()) {
    int xt = dfs_stek.top();
    int dt = depth.top();
    dfs_stek.pop();
    depth.pop();
    sol += 1.0 / dt;
    mark[xt] = true;
    for (int i = 0; i < graf[xt].adj.size(); i++) {
      int xt1 = graf[xt].adj[i];
      if (!mark[xt1]) {
        mark[xt1] = true;
        dfs_stek.push(xt1);
        depth.push(dt + 1);
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    graf[x].adj.push_back(y);
    graf[y].adj.push_back(x);
  }
  DFS();
  printf("%.10lf\n", sol);
  return 0;
}
