#include <bits/stdc++.h>
using namespace std;
vector<int> s[100010];
bool flag[100010];
long double ans;
void dfs(int now, int deep) {
  ans += 1.0 / (deep * 1.0);
  flag[now] = false;
  for (int i = 0; i < s[now].size(); i++) {
    int next = s[now][i];
    if (flag[next]) dfs(next, deep + 1);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    s[x].push_back(y);
    s[y].push_back(x);
  }
  memset(flag, true, sizeof(flag));
  ans = 0;
  dfs(1, 1);
  cout << fixed << setprecision(6) << ans << endl;
  return 0;
}
