'use strict'

function solve(N, P) {
  var permutation = [['H', 1, P[0]], ['T', -1, 1 - P[0]]]
  var pos = [['H', 1], ['T', -1]]
  var res = 0
  for (var i = 1; i < N; i++) {
    var newPermutation = []
    for (var k = 0; k < pos.length; k++) {
      for (var j = 0; j < permutation.length; j++) {
        var p = []
        p[0] = permutation[j][0] + pos[k][0]
        p[1] = permutation[j][1] + pos[k][1]
        p[2] = pos[k][0] === 'H' ? permutation[j][2]*P[i] : permutation[j][2]*(1-P[i])
        if (p[1] < 0 && Math.abs(p[1]) >= (N -1 - i)) {
          continue
        }
        newPermutation.push(p)
      }
    }
    permutation = newPermutation
  }
  permutation = permutation.filter(p => p[1] > 0)
  for (var i = 0; i < permutation.length; i++) {
    res = res + permutation[i][2]
  }
  return res
}

function main(input) {
  var lines = input.split("\n")
  var N = lines[0]
  var P = lines[1].split(' ').map(l => parseFloat(l))
  var ans = solve(N, P)
  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));