#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
double res = 0;
void dfs(int x, int p, int depth) {
  for (auto nx : adj[x])
    if (nx != p) dfs(nx, x, depth + 1);
  res += 1. / depth;
}
int main() {
  int n;
  scanf("%d", &n);
  adj.assign(n + 1, vector<int>());
  for (int x, y, i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1, -1, 1);
  cout.precision(15);
  cout << fixed << res;
}
