Another idiomatic version of the question using the verb BE:
How many stories [alt. spelling storeys] is the building?
How many weeks is the course?
How many years was the (prison) sentence?
How many feet is the tape measure?
How many processors is that new CPU?
How many pages is the book?
This is an informal, conversational construction.
P.S. Why don't your versions work, which have a structure like "how many page a book"? Because phrases of the "how many page" variety do not resolve to anything grammatical. Such a phrase does not yield the adjective of degree required for constructions like "how big a dog was it?". Nor do they yield the cardinal number required by constructions like "How many years was the sentence?"