#include <bits/stdc++.h>
using namespace std;
int maxn = 100005;
vector<int> adj[100005];
long long int tabaghe[100005];
bool mk[100005];
int n, a, b;
void dfs(int x, int lvl) {
  mk[x] = true;
  tabaghe[x] = lvl;
  for (auto y : adj[x]) {
    if (!mk[y]) {
      dfs(y, lvl + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(0, 1);
  double ans = 0;
  for (int i = 0; i < n; i++) ans += (double)1 / ((double)tabaghe[i]);
  cout << fixed << setprecision(12) << ans;
}
