#P1765. 手机
手机
Description
A typical mobile phone keypad looks like this:

To type an English letter, you need to press a number key multiple times. For example, to type , you need to press twice: the first press outputs , and the second turns into . Pressing the key once outputs a space.
Your task is to read a sentence that contains only lowercase English letters and spaces, and find the minimum number of key presses required to type this sentence on the phone.
Input Format
One line containing a sentence that consists of lowercase English letters and spaces, with length at most 200 characters.
Output Format
One line with one integer, the total number of key presses.
i have a dream
23
Hint
NOI Bulletin 2010 Junior (10).
Translated by ChatGPT 5
京公网安备 11011102002149号