#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using pi = pair<int, int>;
const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const int inf = 1e7;
const int MAXN = 1e5 + 5;
vector<vector<int>> adj;
vector<int> depth;
void dfs(int u, int par, int d) {
  depth[u] = d;
  for (int v : adj[u])
    if (v != par) dfs(v, u, d + 1);
}
void cp() {
  int n;
  cin >> n;
  adj.resize(n + 1), depth.assign(n + 1, 0);
  for (int i = 0, u, v; i < n - 1; i++)
    cin >> u >> v, adj[u].push_back(v), adj[v].push_back(u);
  dfs(1, 1, 1);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += 1.0 / double(depth[i]);
  cout << setprecision(20) << fixed;
  ;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    cp();
  }
  return 0;
}
