Input: Sentence: 'A cat with its head stuck firmly inside a glass trying to get a sip'. Count the number of nouns in this sentence.
Output: 4