#CCBCHBAHAI0000143. Tỷ lệ đánh bóng (Batter Up)

Tỷ lệ đánh bóng (Batter Up)

Batter Up

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

A player has nn plate appearances. Each value is encoded as follows:

  • 0, 1, 2, 3, 4 are the number of bases earned on an official at-bat;
  • -1 is a walk, which is excluded from both the numerator and the number of official at-bats.

The slugging percentage is the sum of bases from official at-bats divided by the number of official at-bats.

Compute the player's slugging percentage.

Input

  • The first line contains an integer nn.
  • The second line contains nn integers a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} using the encoding above.

Output

Print the slugging percentage as a real number. The answer is accepted if its absolute or relative error does not exceed 10−310^{-3}.

Subtasks

Subtask 1 (100 points): 1≤n≤1001\le n\le100; every ai∈{−1,0,1,2,3,4}a_i\in\{-1,0,1,2,3,4\}; at least one ai≠−1a_i\ne-1.

Examples

Input

3
1 -1 4

Output

2.5

Explanation

The -1 value is a walk and is ignored. The remaining two official at-bats earn 11 and 44 bases, for a total of 55 bases over 22 official at-bats. The slugging percentage is therefore 5/2=2.55/2=2.5.