Input: Sentence: 'A motorcycle with long rails hanging from it'. Count the number of nouns in this sentence.
Output: 2