Input: Sentence: 'A dog and a cat sitting side by side with their heads pressed together'. Count the number of nouns in this sentence.
Output: 5