var fs = require('fs')
var nums = fs.readFileSync('/dev/stdin')
	.toString()
	.split('\n')[1]
	.split(' ')
console.log(getHeadsSuperior(nums))

function getHeadsSuperior(nums) {
    var probabilities = new Array(nums.length + 1)
    for (var i = 0; i < probabilities.length; i++) {
        if (probabilities[i] === undefined) {
            probabilities[i] = new Array(nums.length + 1)
        }
        for (var j = 0; j < probabilities.length; j++) {
            if (i === 0) {
                probabilities[i][j] = j === 0 ? 1 : 0
                continue
            }
            probabilities[i][j] = 0
            if (probabilities[i - 1] !== undefined) {
                if (probabilities[i - 1][j] !== undefined) {
                    probabilities[i][j] += probabilities[i - 1][j] * (1 - nums[i - 1])
                }
                if (probabilities[i - 1][j - 1] !== undefined) {
                    probabilities[i][j] += probabilities[i - 1][j - 1] * nums[i - 1]
                }
            }
        }
    }
    return probabilities[probabilities.length - 1]
                .slice(Math.ceil(probabilities.length / 2))
                .reduce((a, b) => a + b, 0)
}