P7678 [COCI 2008/2009 #5] LJESNJAK

Description

Not long ago, when operating systems were not as advanced as they are today, computers could not display some letters in the Croatian alphabet. Therefore, programmers were allowed to replace one such letter with two to three characters that computers could display, as shown in the table below. | Letter that cannot be displayed | Replacement characters | | :----------: | :----------: | | `č` | `c=` | | `ć` | `c-` | | `dž` | `dz=` | | `ñ` | `d-` | | `lj` | `lj` | | `nj` | `nj` | | `š` | `s=` | | `ž` | `z=` | For example, the string `ljes=njak` can represent six letters in the Croatian alphabet: `lj`, `e`, `š`, `nj`, `a`, `k`. Now you are given a string. Please find how many letters in the Croatian alphabet the decoded string contains. The matching is greedy: always match the longest possible letter at the current position. For example, `lj` should not be considered as two English letters `l` and `j`. Besides the special letters listed in the table above, the Croatian alphabet also contains the 26 English letters `a` to `z`.

Input Format

The input contains only one line: a string representing an encoded string in the way described above.

Output Format

Output only one line: the number of letters in the Croatian alphabet contained in the decoded string.

Explanation/Hint

**Constraints** For all testdata, the length of the string does not exceed $100$, and it contains only lowercase letters and the characters `-` and `=`. **Source** This problem is from **_[COCI 2008-2009](https://hsin.hr/coci/archive/2008_2009/) [CONTEST 5](https://hsin.hr/coci/archive/2008_2009/contest5_tasks.pdf) T1 LJESNJAK_**. Using the original testdata configuration, the full score is $30$ points. Translated and organized by [Eason_AC](https://www.luogu.com.cn/user/112917). Translated by ChatGPT 5