#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17 + 9;
double ans = 0;
vector<int> adj[100009];
int vis[100009];
double dfs(int x, double prof) {
  vis[x] = 1;
  double ret = 1 / prof;
  for (auto e : adj[x]) {
    if (vis[e] == -1) ret += dfs(e, prof + 1);
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  memset(vis, -1, sizeof vis);
  cout << fixed << setprecision(6);
  long long n;
  cin >> n;
  long long m = n - 1;
  while (m--) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  cout << dfs(1, 1) << '\n';
  return 0;
}
