P1765 Mobile Phone

Description

A typical mobile phone keypad looks like this: ![](https://cdn.luogu.com.cn/upload/image_hosting/yq2orii6.png) To type an English letter, you need to press a number key multiple times. For example, to type $\tt x$, you need to press $9$ twice: the first press outputs $\tt w$, and the second turns $\tt w$ into $\tt x$. Pressing the $0$ 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.

Explanation/Hint

NOI Bulletin 2010 Junior (10). Translated by ChatGPT 5