Average#8064

Average

1 second
128 megabytes
Easy

In college, a student may take several courses. For each course , he earns a certain credit c_i, and a mark ranging from **A** to **F**, which is comparable to a score s_i, according to the following conversion table:

![conversion table](https://static.e-olymp.com/content/9c/9c18cc948dfe319f9a4efb3df897c48a30880182.gif)

The GPA is the weighted average score of all courses one student may take, if we treat the credit as the weight. In other words,

![GPA formula](https://static.e-olymp.com/content/84/84c6c3c6cdf4479b6548812c1cee38468cad7151.gif)

An additional treatment is taken for special cases. Some courses are based on "Pass/Not pass" policy, where students earn a mark '**P**' for "Pass" and a mark '**N**' for "Not pass". Such courses are not supposed to be considered in computation. These special courses must be ignored for computing the correct GPA. Specially, if a student's credit in GPA computation is , his/her GPA will be .

Input

There are several (about ) test cases. Each test case starts with a line containing one integer (1 \le n \le 1000), the number of courses. Then lines follow, each containing the credit and the mark of one course. Credit is a positive integer less than .

Output

For each test case print the GPA, rounded up to two decimal places.

Examples

Example 1

Loading
Loading