Input: Sentence: 'A bed in a bedroom with a heart shaped box on it'. Count the number of nouns in this sentence.
Output: 4