#include <bits/stdc++.h>
using namespace std;
ifstream Cin("input.txt");
ofstream Cout("output.txt");
vector<long long> e[100001];
double ans = 0;
void dfs(long long cur, long long p, long long d) {
  ans += 1. / d;
  long long i, sz = (long long)e[cur].size(), next;
  for (i = 0; i < sz; i++) {
    next = e[cur][i];
    if (next != p) dfs(next, cur, d + 1);
  }
}
int main() {
  long long n, i, a, b;
  cin >> n;
  for (i = 1; i <= n - 1; i++)
    cin >> a >> b, e[a].push_back(b), e[b].push_back(a);
  dfs(1, -1, 1);
  cout << setprecision(9) << ans;
}
