QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#15219. Update

统计

The global replace function is a very useful feature. Using this function, you can easily modify strings in an editor.

Iris is a cute cat. She randomly tapped on oql's keyboard several times, which happened to form a string consisting only of lowercase letters.

oql especially likes the letter i. He wants to change all letters in this string to i, and is prepared to perform the following operation several times (it is possible that no operations are needed):

  • Choose two letters $x, y$ from a ~ z, and simultaneously replace all occurrences of $x$ in the string with $y$.

oql wants to know the minimum number of operations required to change all characters to i.

Input

A single line containing a string $s$ consisting of lowercase letters ($1 \le |s| \le 10^4$).

Output

A non-negative integer representing the minimum number of operations.

Examples

Input 1

thomasx

Output 1

7

Input 2

poria

Output 2

4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.