All problems

Rolling an Even Number

easyPythonProbability

Whetcode Games is balancing a board game before it goes to print. One card lets a player take a second move, but only when their roll comes up even, and the designers need to know how often that will actually fire before they decide what the card costs. They are still choosing between several candidate dice, so the figure has to come out of whichever die is in the box rather than out of the ordinary six-sided one.

Every die under consideration is fair — each face equally likely — and the card is settled on a single roll, with no rerolls. Prototype dice do not always read 1 through 6: a face value may be skipped, and it may appear more than once.

Task: Print the probability that one roll of the given die shows an even number, as a plain float — no rounding step and no percent sign.

Input

The first line holds one integer n, the number of faces on the die (1 to 100). Each of the next n lines holds one face value, a whole number from 1 to 1000. Face values may repeat.

Output

One line holding the probability, printed the way Python prints a float: 0.5, never 0.50 and never 50%.

Example:

Input:
6
1
2
3
4
5
6

Output:
0.5

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…