#include <bits/stdc++.h>
using namespace std;
const int maxN = 1 * 100000 + 10, mod = (int)1e9 + 7;
int n;
vector<int> v[maxN];
bool mark[maxN];
long double s = 0;
void dfs(int i, int h) {
  mark[i] = 1;
  s += (long double)1 / h;
  for (int j = 0; j < v[i].size(); ++j)
    if (mark[v[i][j]] == 0) dfs(v[i][j], h + 1);
}
int main(void) {
  ios_base::sync_with_stdio(0);
  int x, y;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(0, 1);
  printf("%.6f", s);
  return 0;
}
