Programming contests

DEIK Regionális Programozó Csapatverseny, középiskolai kategória, 2016. december 4.

December 4, 2016, 10:10 AM – December 4, 2016, 3:10 PM

Vowel or Odd Number

Each card in a deck has an uppercase letter of the English alphabet on one side, and an integer number on the other side. There is exactly one letter and one number on each card. Somebody makes the following statement about this card deck:

If there is a vowel on the letter side of a card, then its number side shows an even number.

(Vowels are the following letters: A, E, I, O, and U.)

To determine whether this statement is true, we obviously have to have a look at the other side of certain cards.

Your task is to write a program that

  1. reads data describing one side of the cards,
  2. computes the minimum number of cards that have to be flipped over in the worst case to be able to determine without any doubt whether the above statement is true for all cards in the deck,
  3. and prints the result.

Input Specification

The input consists of multiple test cases. Each line of a test case contains either an uppercase letter of the English alphabet or an integer. Test cases are terminated by a line containing the string “END”. You may assume that each test case contains at least one line describing a card.

Output Specification

For each test case, your program should output one line containing one integer: the minimum number of cards that need to be flipped over.

Sample Input

  1. E
  2. K
  3. 4
  4. 7
  5. END
download as text file

Output for Sample Input

  1. 2
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024