Input: Sentence: 'A dog sits on a bed next to a cellphone and a pen'. Count the number of nouns in this sentence.
Output: 4