#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> e[100008];
vector<int> ch[100008];
bool volt[100008];
void bejar(int id) {
  if (volt[id]) return;
  volt[id] = true;
  for (unsigned i = 0; i < e[id].size(); i++) {
    if (!volt[e[id][i]]) {
      ch[id].push_back(e[id][i]);
      bejar(e[id][i]);
    }
  }
}
double pt[100008];
double p(int id, int h) {
  if (pt[id] != 0) return pt[id];
  double ans = 1.0 / h;
  for (unsigned i = 0; i < ch[id].size(); i++) {
    ans += p(ch[id][i], h + 1);
  }
  pt[id] = ans;
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  bejar(1);
  printf("%.9f", p(1, 1));
  return 0;
}
