QOJ.ac

QOJ

时间限制: 0.25 s 内存限制: 256 MB 总分: 10

#223. Polish language [B]

统计

Bajtek, the youngest employee of the newly opened Bajtocja embassy in Poland, is discovering at every turn that the Polish language can be difficult for foreign guests. He has particular trouble with words that contain three consecutive consonants (such as "kostka" or "potyczki") or three consecutive vowels* ("geoinżynieria", "nieautoryzowany") — he is unable to pronounce such words, which makes him a frequent target of his colleagues' crude jokes.

Christmas is approaching, and the PR department has come up with a brilliant (or so they think) idea: recording a video with holiday wishes for Poles, which will be read by Bajtocjanie one by one. The full text of the wishes has already been sent to all embassy employees. The text is a string containing no spaces (most employees know Polish no better than Bajtek, so word division would only hinder them) and no Polish characters (in truth, no one wants to know how the average Bajtocjanin reads "ź").

Bajtek does not yet know which part of the wishes he will be assigned to read, but he would like to assess how poor his chances are. Calculate how many possible substrings of the text he will be unable to pronounce (due to three consecutive consonants or vowels).

Input

The first and only line of input contains a string consisting of lowercase English letters, containing at least one and at most 200,000 characters.

Output

Your program should output a single integer – the number of substrings that are difficult for Bajtek. If an identical difficult substring appears in two (or more) places in the text, it should be counted multiple times.

Examples

Input 1

kostka

Output 1

6

Note 1

The difficult substrings for Bajtek are: stk, ostk, kostk, stka, ostka, and kostka.

Input 2

aaaa

Output 2

3

*For the record, we remind you that the vowels are the letters "a", "e", "i", "o", "u", and "y".

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.