A scientist wants to analyse the emotions of chatters by extracting text-based emoticons within a chat log, which is a text string. He considers four emoticons and assigns them different values for each level of happiness:
:( a colon followed by an open parenthesis means sad. It is assigned the value -1.:(( a colon followed by two open parentheses means very sad. It is assigned the value -5.
:) a colon followed by a close parenthesis means happy. It is assigned the value 2.
:)) a colon followed by two close parentheses means very happy. It is assigned the value 4.
The input file consists of several data sets. The first line of the input file contains the number of data sets which is a positive integer and is not bigger than 20. The following lines describe the data sets.
Each data set consists of only one line, which contains the text string representing the chat log.
For each data set, write in one line the level of happiness of the chat log.
3 I am happy :), very happy :)). I am happy :(, no actually sad :(( I win :), but I lost some friends :(:(, kidding :))
6 -6 4
Migrated from old NTUJ.
The ACM-ICPC 2010 Asia Regional Contest, Site Hanoi
No. | Testdata Range | Score |
---|