#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
long double res = 0;
bool vis[1000005];
void dfs(int n, long double d) {
  if (vis[n]) return;
  vis[n] = true;
  res += 1 / d;
  for (auto x : adj[n]) dfs(x, d + 1);
}
int main() {
  int n;
  cin >> n;
  adj.assign(n + 2, vector<int>());
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    adj[x].push_back(y), adj[y].push_back(x);
  }
  dfs(1, 1);
  cout << fixed << setprecision(13) << res;
}
