What Is This Semester's GPA?

Time limit1sMemory limit128 MB

Problem

Given the courses a student took this semester, each course's credit value, and each course's grade, write a program that computes the student's grade point average.

There are 13 possible grades from A+ through F.

  • A+: 4.3, A0: 4.0, A-: 3.7
  • B+: 3.3, B0: 3.0, B-: 2.7
  • C+: 2.3, C0: 2.0, C-: 1.7
  • D+: 1.3, D0: 1.0, D-: 0.7
  • F: 0.0

The grade point average is the sum of credits * grade_points over all courses divided by the total number of credits.

Input

The first line contains the number of courses N taken this semester.

Each of the next N lines contains a course name, the course's credits, and its grade.

A course name consists only of lowercase English letters, digits, and underscores (_), and has length at most 100. Credits are natural numbers from 1 to 3, inclusive. Each grade is one of the 13 grades listed in the statement.

Output

Print the grade point average rounded to two digits after the decimal point. If the average is 1.5, print 1.50.