#include <bits/stdc++.h>
using namespace std;
vector<int> node[100001];
bool visit[100001];
double ans;
void dfs(int start, int height) {
  visit[start] = true;
  ans += 1.0 / height;
  for (int i = 0; i < node[start].size(); i++) {
    if (visit[node[start][i]] == false) {
      dfs(node[start][i], height + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    node[i].clear();
    visit[i] = false;
  }
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    node[a].push_back(b);
    node[b].push_back(a);
  }
  ans = 0;
  dfs(1, 1);
  cout << setprecision(20) << ans << endl;
  return 0;
}
