We live in a simulation.

Exclusive Normal+ 4 Math HRT

For each day, the probability a machine fails is pp. Given a binary string of dd days of data, where 11 is a failure on that day, estimate the probability pp' of 55 of these machines failing on the same day.

Define a program that takes in an string representing d days of data from one machine, and outputs the optimal unbiased estimation for p', where "optimal" means the estimator has the minimum variance among all valid unbiased estimators.

Answers within 1e51e{-5} of the expected answer will be accepted. In other words, do not worry about floating point truncations or rounding offsets.


Notes

  • Assume machine failures are independent across machines
  • The estimator should be a function of the observed data only (no simulation/randomization)

Constraints

  • 55 \le d 100\le 100
  • d consists of only '1' or '0'

Examples

Example 1
Input:1001101110
Output:~0.02380952
Example 2
Input:010111011010011111001111101110
Output:~0.108795419
Accepted 3/5
Acceptance 60%
Loading editor...
Sample Input:
1001101110
Expected Output:
0.023809523809523808