import java.util.Locale;

public class Euler232 {
    static int computeTLimit(int target) {
        int t = 1;
        long score = 1;
        while (score < target && t < 60) {
            t++;
            score <<= 1;
        }
        return t + 4;
    }

    static double p1TurnValue(double[][] f, int a, int b) {
        if (a <= 0)
            return 0.0;
        if (b <= 0)
            return 1.0;
        double prevRow = (a == 1) ? 0.0 : f[a - 1][b];
        return 0.5 * (f[a][b] + prevRow);
    }

    public static String solve() {
        int target = 100;
        double[][] f = new double[target + 1][target + 1];

        for (int a = 1; a <= target; ++a) {
            f[a][0] = 1.0;
        }

        int tLimit = computeTLimit(target);
        double[] q = new double[tLimit + 1];
        int[] score = new int[tLimit + 1];

        for (int t = 1; t <= tLimit; ++t) {
            q[t] = Math.pow(2.0, -t);
            score[t] = 1 << (t - 1);
        }

        for (int a = 1; a <= target; ++a) {
            for (int b = 1; b <= target; ++b) {
                double prevSameB = (a == 1) ? 0.0 : f[a - 1][b];
                double bestValue = 0.0;

                for (int t = 1; t <= tLimit; ++t) {
                    int gain = score[t];
                    double successValue = (gain >= b) ? 1.0 : p1TurnValue(f, a, b - gain);

                    double qt = q[t];
                    double candidate = (2.0 * qt * successValue + (1.0 - qt) * prevSameB) / (1.0 + qt);

                    if (candidate > bestValue) {
                        bestValue = candidate;
                    }
                }

                f[a][b] = bestValue;
            }
        }

        double startProbability = p1TurnValue(f, target, target);
        return String.format(Locale.US, "%.8f", startProbability);
    }

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