AT_abc421_e [ABC421E] Yacht

Description

There are five six-sided dice. Each die has the numbers $ A_1,\ldots,A_6 $ written on its faces, and each face appears with probability $ \frac{1}{6} $ . You will play a single-player game using these dice with the following procedure: 1. Roll all five dice, observe the results, and **keep** any number (possibly zero) of dice. 2. Re-roll all dice that are not kept, observe the results, and additionally keep any number (possibly zero) of the re-rolled dice. **The dice kept in the previous step remain kept**. 3. Re-roll all dice that are not kept and observe the results. 4. Choose any number $ X $ . Let $ n $ be the number of dice among the five dice that show $ X $ . The score of this game is $ nX $ points. Find the expected value of the game score when you act to maximize the expected value of the game score.

Input Format

The input is given from Standard Input in the following format: > $ A_1 $ $ A_2 $ $ A_3 $ $ A_4 $ $ A_5 $ $ A_6 $

Output Format

Print the answer. Your answer will be considered correct if the relative or absolute error from the true value is at most $ 10^{-5} $ .

Explanation/Hint

### Sample Explanation 1 For example, the game may proceed as follows (not necessarily optimal): 1. Roll all five dice and get $ 3,3,1,5,6 $ . Keep the two dice that show $ 3 $ . 2. Re-roll the three dice that are not kept and get $ 6,6,2 $ . Additionally keep the two dice that show $ 6 $ . 3. Re-roll the one die that is not kept and get $ 4 $ . 4. Choose $ X = 6 $ . The dice show $ 3,3,6,6,4 $ , so the number of dice showing $ 6 $ is $ 2 $ , and the score of this game is $ 12 $ . In this case, the expected value when acting optimally is $ \frac{143591196865}{9795520512}=14.6588633742\ldots $ . ### Sample Explanation 2 The dice may have faces with the same value written on them. ### Constraints - $ A_i $ is an integer between $ 1 $ and $ 100 $ , inclusive.