import java.util.Locale;

public class Euler567 {
    static double harmonicAsymptotic(long n) {
        double gamma = 0.577215664901532860606512090082402431;
        double nn = (double) n;
        double inv = 1.0 / nn;
        double inv2 = inv * inv;
        return Math.log(nn) + gamma + 0.5 * inv - (1.0 / 12.0) * inv2;
    }

    static double B_large(long n) {
        int K = (int) Math.min(n - 1, 200L);
        double S = 0.0;
        double pow2 = 1.0;
        for (int j = 0; j <= K; j++) {
            S += pow2 / (double) (n - j);
            pow2 *= 0.5;
        }
        return S;
    }

    static double S_large(long m) {
        double Hm = harmonicAsymptotic(m);
        double Bm = B_large(m);
        double twoLn2 = 2.0 * Math.log(2.0);
        return 4.0 * Hm - 2.0 * Bm - twoLn2;
    }

    public static String solve() {
        long m = 123456789L;
        double ans = S_large(m);
        return String.format(Locale.US, "%.8f", ans);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
