'''
Created on Sep 23, 2017

@author: Susan
'''
def isVowel(ch):
    return ch in "aeiou"

def countVowelWords(phrase):
    count = 0
    for word in phrase.split():
        start = word[0]
        end = word[-1]
        if isVowel(start) and isVowel(end) and start != end:
            count += 1
    return count



if __name__ == '__main__':
    phrase = "an apple a day keeps the doctor away"
    print phrase, countVowelWords(phrase)
    
