#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
const double one = 1.0;
double ans = 0.0;
vector<int> G[MAXN];
void DFS(int o, int f, int d) {
  ans += one / d;
  for (auto u : G[o])
    if (u != f) DFS(u, o, d + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  int N;
  cin >> N;
  for (int i = 1; i < N; ++i) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  DFS(1, -1, 1);
  cout << ans << endl;
}
