#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n;
double sol = 0;
vector<int> graph[MAXN];
int visited[MAXN];
void dfs(int node, int depth) {
  if (visited[node]) return;
  visited[node] = 1;
  sol += (1.0 / (double)depth);
  for (int i = 0; i < (int)graph[node].size(); i++)
    dfs(graph[node][i], depth + 1);
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  dfs(0, 1);
  printf("%.9lf\n", sol);
  return 0;
}
