#include <iostream>
#include <random>

using namespace std;

default_random_engine rnd(random_device{}());

bool ok()
{
    bool win[2] = {};
    uniform_int_distribution<>d(0,1);
    uniform_real_distribution<>r(0.0,1.0);

    if (d(rnd))
    {
        win[0] = r(rnd) < 0.7;
        win[1] = r(rnd) < 0.6;
    }
    else
    {
        win[1] = r(rnd) < 0.7;
        win[0] = r(rnd) < 0.6;
    }
    return win[0] && win[1];
}


int main()
{
    int wins = 0, total = 1000000;
    for(int i = 0; i < total; ++i)
        if (ok()) wins++;
    cout << double(wins)/total << endl;
}
