#C1219. Count Vowels in a String
Count Vowels in a String
Count Vowels in a String
You are given a string and you are required to count the number of vowels in it. Vowels are considered to be a, e, i, o, u in both uppercase and lowercase forms. Consider the formula \( V = \sum_{i=1}^{n} \mathbb{1}(s_i \in \{a,e,i,o,u,A,E,I,O,U\}) \) where \(\mathbb{1}(condition)\) is 1 if the condition holds and 0 otherwise.
If the input string is empty, the output should be 0.
Your solution should read from stdin
and output the result to stdout
.
inputFormat
The input consists of a single line containing a string s. This string may include letters, spaces, and other characters.
The string is provided through stdin
.
outputFormat
Output a single integer representing the number of vowels present in the input string. The result should be printed to stdout
.
hello
2