#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> adj[100010];
double ans;
void dfs(int x, int p, int d) {
  ans += 1. / d;
  for (int t : adj[x]) {
    if (t != p) {
      dfs(t, x, d + 1);
    }
  }
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 1, x, y; i < N; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1, 0, 1);
  cout << fixed << setprecision(15) << ans << endl;
}
