#include <bits/stdc++.h>
using namespace std;
int n, l[100002];
double ans;
vector<int> G[100002];
void dfs(int x, int p) {
  l[x] = l[p] + 1;
  ans += 1.0 / l[x];
  for (auto it : G[x])
    if (it != p) dfs(it, x);
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(1, 0);
  cout << fixed << setprecision(10) << ans;
  return 0;
}
