#P9078. Count Special Substrings

    ID: 22237 Type: Default 1000ms 256MiB

Count Special Substrings

Count Special Substrings

Given a string s, count the number of its substrings that contain at least one contiguous block of length 3 (or more) consisting entirely of vowels or entirely of consonants.

Note: In Polish the vowels are defined as \(a, e, i, o, u, y\). Every other letter is considered a consonant.

A substring is a contiguous block of characters from the given string. For each substring of s, if there exists any block of at least 3 consecutive characters that are all vowels or all consonants, then count that substring.

inputFormat

The input consists of a single line containing the string s composed of lowercase letters.

outputFormat

Output a single integer — the number of substrings of s which contain at least one contiguous block of 3 or more vowels or 3 or more consonants.

sample

abc
0