Hide

Problem C
Emoticons

Emma is a college student who regularly posts messages on her favorite social media, which supports several emoticons—a pictorial representation of a facial expression using characters. One day, she noticed that some emoticons in her message were automatically converted to the corresponding emojis by the platform. For example, if she sends a message “Hello ;-)” to the platform, the actual post will be “Hello \includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/04.png}”. If two or more emoticons overlap in a message, the system always converts the leftmost emoticon first.

Here is the complete list of the supported emoticons on that social media.

Type

Emoticon

Emoji

Meaning

Western

:)

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/01.png}

Smiley

Western

:-)

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/01.png}

Smiley

Western

:-(

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/03.png}

Frown

Western

;-)

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/04.png}

Wink

Western

xD

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/05.png}

Laughing

Eastern

^_^

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/01.png}

Smiley

Eastern

-_-

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/07.png}

Expressionless

Eastern

^o^

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/08.png}

Screwed

Eastern

^^;

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/09.png}

Sweating

Eastern

(..)

\includegraphics[clip, trim={7px 7px 7px 7px}, width=1.1em, height=1.1em]{images/10.png}

Looking down

She always uses the following “visible” characters and the space character “ ”.

  • Digits: 0123456789

  • Uppercase letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ

  • Lowercase letters: abcdefghijklmnopqrstuvwxyz

  • Symbols: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

Today, just before posting, she accidentally replaced all occurrences of one character in her message with another character. Such characters include space, and she might have replaced a character with the same character, causing no effect. Now, she wants to know the message length after the platform converts emoticons into emojis, where she counts each emoji as one character.

Can you help her find the minimum and maximum possible message lengths?

Input

The input contains Emma’s original text (before she accidentally replaced characters) on one line. The text contains at most $100$ characters, consisting of the visible ASCII characters defined above and the space character. Her text is not empty, and its first and last characters are visible characters.

Output

Output two integers, the minimum and the maximum possible message lengths after emoticons in her message are converted into emojis.

Sample Input 1 Sample Output 1
Hello ;-) world ^^.
15 19
Sample Input 2 Sample Output 2
xDEoE_E
4 7

Please log in to submit a solution to this problem

Log in