LCC '22 Contest 4 J1 - Test Prep

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Ethan has a Physics test the next day that he is frantically studying for, and right now he's texting the smartest kid in the class, D.E. (Short for D.E. Yaniel Elephant Eater 9000), for help.

Every time Ethan understands a concept, he sends :D, and his confidence increases by 1, and every time he doesn't understands one, he sends D: and decreases his confidence by 1.

Additionally, Ethan might be extremely confident or extremely confused about a concept, in which case he will add > or < to his emojis. For every > or < he sends, he increases/ decreases his confidence by 3.

For example, if Ethan sends >>:D, his confidence increases by 7, or if he sends D:<<<<<, his confidence deceases by 16.

Given N lines of input, each containing an emoji Ethan sends to D.E., calculate Ethan's total confidence for his test.

Constraints

1 \le N \le 1000

Input Specification

The first line of input will contain one integer, N.

The next N lines will each contain a string, the i^{th} emoji Ethan sends.

Each emoji is guaranteed to be 1000 characters or less, and it is guaranteed that each line of input contains a valid emoji representing either confidence or confusion, meaning an arragement like >:D>> or >:DD:< is impossible.

Output Specification

Output one integer, Ethan's total confidence.

Sample Input

5
:D
D:
>>:D
D:<
>>>>:D

Sample Output

16

Sample Output Specification

:D = +1

D: = -1

>>:D = +7

D:< = -4

>>>>:D = +13

1 - 1 + 7 - 4 + 13 = 16


Comments

There are no comments at the moment.