#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> edge[100005];
bool mark[N];
int n;
double answer = 0;
void dfs(int v, int k) {
  answer += (double)1 / (double)k;
  mark[v] = true;
  for (auto e : edge[v]) {
    if (!mark[e]) dfs(e, k + 1);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  dfs(0, 1);
  cout << fixed << setprecision(12) << answer << endl;
}
