class HaikuReview {

    public int getNumberOfSyllables(String line) {

        char[] chars = line.toCharArray();
        char previousCharacter = ' ';
        int syllableCount = 0;

        for (int i = 0; i < chars.length; i++) {
            char currentCharacter = chars[i];

            boolean previousCharacterIsAVowel = isAConstantant(previousCharacter);
            boolean endOfLine = i == chars.length - 1;
            if (previousCharacterIsAVowel && endOfLine) {
                syllableCount++;
            } else if (previousCharacterIsAVowel && !isAConstantant(currentCharacter)) {
                syllableCount++;
            }

            previousCharacter = currentCharacter;
        }
        return syllableCount;

    }

}