#include <bits/stdc++.h>
using namespace std;
double ans;
int n;
vector<int> arr[100010];
void dfs(int u, int v, int tol) {
  ans += 1.0 / tol;
  for (int i = 0; i < arr[u].size(); i++)
    if (arr[u][i] != v) dfs(arr[u][i], u, tol + 1);
}
int main() {
  scanf("%d", &n);
  int a, b;
  for (int i = 0; i < n - 1; i++)
    scanf("%d%d", &a, &b), arr[a].push_back(b), arr[b].push_back(a);
  dfs(1, 0, 1);
  printf("%.10f\n", ans);
}
