Using the input, generate a python program to count the number of times a specific word appears in a sentence or a paragraph.
sentence = 'My favorite color is blue'
word = 'blue'
def count_word(sentence, word):
    words = sentence.split(' ')
    return words.count(word)