#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
vector<int> G[N];
double answer = 0;
void dfs(int node, int pre, double dep) {
  answer += 1.0 / dep;
  for (int i : G[node]) {
    if (i == pre) continue;
    dfs(i, node, dep + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, 1, 1);
  cout << fixed << setprecision(9) << answer << endl;
}
