#include <bits/stdc++.h>
using namespace std;
mt19937_64 random_num(
    chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const int base = 26;
int n;
vector<int> ke[100001];
int d[100001];
double res;
void DFS(int u, int pa) {
  d[u] = d[pa] + 1;
  for (int v : ke[u])
    if (v != pa) DFS(v, u);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    ke[u].push_back(v);
    ke[v].push_back(u);
  }
  DFS(1, 0);
  cout << fixed << setprecision(8);
  for (int i = 1; i <= n; i++) res = res + ((double)1 / d[i]);
  cout << res;
}
