#include <bits/stdc++.h>
using namespace std;
const int IINF = 1 << 28;
const double INF = 1e30;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
double res;
vector<vector<int> > E(100005);
int n;
void dfs(int cur, int prev, int depth) {
  res += 1.0 / depth;
  if (depth > n) return;
  for (int i = 0; i < E[cur].size(); ++i) {
    int tmp = E[cur][i];
    if (tmp == prev) {
      continue;
    }
    dfs(tmp, cur, depth + 1);
  }
}
int main() {
  cin >> n;
  n--;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    E[x].push_back(y);
    ;
    E[y].push_back(x);
    ;
  }
  res = 0;
  dfs(0, -1, 1);
  printf("%.10lf\n", res);
}
