#include <bits/stdc++.h>
using namespace std;
namespace Flandle_Scarlet {
class Graph {
 public:
  int head[100100];
  int EdgeCount;
  struct Edge {
    int To, Label, Next;
  } Ed[100100 << 1];
  void clear() {
    memset(Ed, -1, sizeof(Ed));
    memset(head, -1, sizeof(head));
    EdgeCount = 0;
  }
  void AddEdge(int u, int v, int w) {
    ++EdgeCount;
    Ed[EdgeCount] = (Edge){v, w, head[u]};
    head[u] = EdgeCount;
  }
  int Start(int u) { return head[u]; }
  int To(int u) { return Ed[u].To; }
  int Label(int u) { return Ed[u].Label; }
  int Next(int u) { return Ed[u].Next; }
} G;
void Add(int u, int v, int w) {
  G.AddEdge(u, v, w);
  G.AddEdge(v, u, w);
}
int n;
void Input() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    Add(u, v, 1);
  }
}
int deep[100100];
void DFS(int u, int f) {
  deep[u] = (f == -1) ? (1) : (deep[f] + 1);
  for (int i = G.Start(u); ~i; i = G.Next(i)) {
    int v = G.To(i);
    if (~v and v != f) {
      DFS(v, u);
    }
  }
}
void Soviet() {
  DFS(1, -1);
  double ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += (1.00 / (1.00 * deep[i]));
  }
  printf("%.10f\n", ans);
}
void IsMyWife() {
  if (0) {
    freopen("", "r", stdin);
    freopen("", "w", stdout);
  }
  G.clear();
  Input();
  Soviet();
}
};  // namespace Flandle_Scarlet
int main() {
  Flandle_Scarlet::IsMyWife();
  return 0;
}
