#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  while (b) {
    b ^= a ^= b ^= a %= b;
  }
  return a;
}
long long LCM(long long a, long long b) { return (a / GCD(a, b) * b); }
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P & 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return (long long)R;
}
string toString(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
vector<int> e[1000007];
int d[1000007] = {0};
void dfs(int u, int deep) {
  d[u] = deep;
  for (__typeof(e[u].begin()) it = e[u].begin(); it != e[u].end(); it++) {
    if (d[*it]) continue;
    dfs(*it, deep + 1);
  }
}
int main() {
  int n;
  cin >> n;
  for (__typeof(n - 1) i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 1);
  double ans = 0;
  for (__typeof(n) i = 1; i <= n; i++) ans += 1. / double(d[i]);
  printf("%.10lf\n", ans);
}
