#Lutece0796. DAGE(Big Brother)

DAGE(Big Brother)

Migrated from Lutece 796 DAGE(Big Brother)

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Our famous “DAGE”, God Kufeng, likes killing monsters. However, killing monsters is a tiring job, and might do harm to DAGE’s health.

Now there are n monsters, each monster has a strength value. Let’s say, before killing a monster with strength XX, DAGE has a health point(HP) as VV, then after killing, DAGE’s HP will become

Vnew=V&XV_{new} = V \&X

Here & means bitwise AND. For example, 5&4=45 \& 4 = 4, 5&2=05 \& 2 = 0.

At first, the health point(HP) of DAGE will be 20472047.

DAGE has a simple strategy, each time he just randomly choose a monster to kill, and kill that monster.

When DAGE’s HP becomes 00, DAGE will feel tired and go home to sleep.

What is the expected number of monsters DAGE has killed when DAGE goes to bed? It is guaranteed that DAGE will go to bed at some moment.

Input

The first line contains a single number nn, the number of the monsters. (1n501\leq n\leq 50)

The the second line comes with nn numbers x1,x2,,xnx_1, x_2, \cdots, x_n, those are the strenght value of each monster. (0xi2047)(0\leq x_i\leq 2047).

Output

Output a single number in a line, the expected number of monsters DAGE has killed when he goes to bed, rounded to 3 digits after decimal point.

Samples

输入数据 1

3
0 1 2

输出数据 1

1.667

Resources

the 12th UESTC Programming Contest Preliminary