#include <bits/stdc++.h>
using namespace std;
double r = 0.;
int n;
vector<int> g[100005];
void dfs(int x, int f, int d) {
  r += 1. / d;
  for (int i = 0, to = g[x].size(); i < to; ++i) {
    int y = g[x][i];
    if (y == f) continue;
    dfs(y, x, d + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, to = n; i < to; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, -1, 1);
  printf("%.12lf\n", r);
  return 0;
}
