시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB20818115187.283%

문제

Mark keeps a log of all the bills in his wallet, but the log does not indicate the actual value of the bills - it simply states the last name of the president on the front of each bill. You are to determine the actual value of the bills in Mark’s wallet.

입력

The first line of input will contain a single integer n that indicates the number of lines to follow. Each line will consist of a series of last names of presidents. The presidents that could appear are: Franklin, Grant, Jackson, Hamilton, Lincoln, and Washington. The values of these presidents are \$100, \$50, \$20, \$10, \$5, and \$1, respectively.

출력

Output the value of the money in the wallet with a dollar sign in front.

예제 입력 1

3
Franklin Grant Jackson
Hamilton Lincoln Washington
Washington Washington Washington Franklin Jackson

예제 출력 1

$170
$16
$123