#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int N = 1e5 + 10;
int n;
vector<int> g[N];
int depth[N];
void dfs(int v, int par) {
  for (auto u : g[v])
    if (u != par) {
      depth[u] = depth[v] + 1;
      dfs(u, v);
    }
}
void solve() {
  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, 1);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans = ans + 1.0 / (depth[i] + 1);
  cout << fixed << setprecision(20) << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
