" "Cats" is the (bare) subject. The phrase "how many cats" is a noun phrase, so if you divide the sentence into 3 parts - subject / verb / object - then that whole noun phrase is considered to be the subject part of the sentence. Noun phrases can be very long with adverbs, adjectives, phrases, etc.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.