import heapq
N = int(input())
S = input()
A = [int(round(float(s)*1000000)+0.5) for s in S.split(' ')]
choose = []
for i in range(21):
choose.append([])
for j in range(21):
if (i < j):
choose[i].append(0)
elif (j == 0):
choose[i].append(1)
else:
choose[i].append(choose[i-1][j-1] + choose[i-1][j])
ans = 0
q = []
for a in range(N+1):
for b in range(N+1):
for c in range(N+1):
if (a+b+c <= N):
cur = [a, b, c, N-a-b-c]
ways = 1
for i in range(4):
for j in range(cur[i]):
ways *= A[i]
for i in range(N):
ways = ways / 1000000
val = choose[N][a] * choose[N-a][b] * choose[N-a-b][c]
heapq.heappush(q, [ways, val])
while len(q) > 1 or q[0][1] > 1:
cur = heapq.heappop(q)
if cur[1] == 1:
nxt = heapq.heappop(q)
heapq.heappush(q, [cur[0]+nxt[0], 1])
ans += cur[0]+nxt[0]
if (nxt[1] > 1):
heapq.heappush(q, [nxt[0], nxt[1]-1])
else:
cnt = cur[1] // 2
ans += cnt * 2 * cur[0]
heapq.heappush(q, [cur[0]*2, cnt])
if (cur[1] % 2 == 1):
heapq.heappush(q, [cur[0], 1])
print(ans)