Input: Sentence: 'The street is barred for a train to pass'. Count the number of nouns in this sentence.
Output: 2