#include <bits/stdc++.h>
using namespace std;
int countBits(long long mask) {
  int res = 0;
  while (mask) mask &= (mask - 1), ++res;
  return res;
}
string toString(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
long long toNumber(string s) {
  stringstream ss;
  long long n;
  ss << s;
  ss >> n;
  return n;
}
long double res;
vector<vector<int> > adjList;
void rec(int node, int parent, int depth) {
  res += 1. / depth;
  for (int i = (int)(0), _m = (int)(adjList[node].size()); i < _m; ++i)
    if (adjList[node][i] != parent) rec(adjList[node][i], node, depth + 1);
}
int main() {
  int n, a, b;
  while (cin >> n) {
    adjList.clear();
    adjList.resize(n + 1);
    for (int i = (int)(0), _m = (int)(n - 1); i < _m; ++i) {
      cin >> a >> b;
      adjList[a].push_back(b);
      adjList[b].push_back(a);
    }
    res = 0;
    rec(1, -1, 1);
    cout.precision(7);
    cout << fixed << res << endl;
  }
}
