#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
vector<int> adj[N];
int dep[N], n;
void dfs(int v, int depth = 0, int par = -1) {
  dep[v] = depth;
  for (int i = 0; i < (int)adj[v].size(); i++)
    if (adj[v][i] != par) dfs(adj[v][i], depth + 1, v);
}
int main() {
  scanf("%d", &n);
  for (int x, y, i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = ans + ((double)1 / ((double)dep[i] + 1));
  }
  printf("%.20f\n", ans);
  return 0;
}
