Harry Potter Query: First Years

Warning: this post may not be thrilling to you if you are not interested in/curious about Harry Potter minutia.

I'm busy rereading Harry Potter, and moving rather slowly. I have no particular deadline in mind, but thought it would be a good time to get reacquainted with the books. It has been a while. I used to reread each book as the next came out, resulting in my reading the first Harry Potters many times more than I read the later ones. I anticipate a few "No way!" moments when I get down the line, but for now I'm meandering through Harry Potter and the Sorcerer's Stone.

It's an interesting read, especially considering how many things J. K. Rowling brought back in later books. I'm sure there have been interviews on this, but did she really plot out every book that carefully, in advance? It seems just a little insane -- certainly I'm nowhere near that as a writer.

Anyway, here's one question that just occurred to me as I was reading the bit about Harry and company being sorted into their respective Houses. (I'm hoping that another rabid fan out there may be able to answer/clarify this point...) The narrative states that when Harry and his Gryffindor crew hop up to the dormitory for the first time, there is a room with five beds in it, one for each of the boys. I assume that this means there were only five male Gryffindor first years that year: Harry, Ron, Seamus, Neville, and Dean.

Carrying this further (based on the number of brooms present at the first flying lesson: twenty, for the Gryffindor and Slytherin first years combined), there are a: exactly five female first years per House, and b: exactly ten first years total per House. This comes out (assuming a 100% retention rate) to seventy students per House, two hundred and eighty students in the entire school.

Was this obvious to everyone else? Was I just being silly when I was thinking that we only focused on a few Hogwarts students per year, and there were many more who simply weren't that important? (Because this means that each student is much more important than I previously gave them credit for...)

Anyway, that's not my actual question. My question is, then: If the five and ten student quotas are set, then doesn't that mean the Sorting Hat has two tasks? First, to sort the students into their appropriate Houses, and second, to fill the quota? And if the Sorting Hat must fill the quota, then what happens if there are more students appropriate for a certain House than there are spaces? One assumes that the Sorting Hat reads your true nature and places you appropriately, but if there is a quota on how many students are sorted into each House, can this be absolutely true? OR, does this mean that admissions letters are sent to the appropriate batch of students in the first place, and the Sorting Hat is just reaffirming what the professors (or admissions committee, or whatever) knew already about which students will end up in which House?

Of course, the free-wheeling, all-powerful nature of the Sorting Hat is touted from Sorcerer's Stone onward, so it doesn't make much sense that the Sorting Hat is just reaffirming something that's already known. But if the Sorting Hat is really free to choose (and if the students, like Harry, have some say about which is their House), then how can that be reconciled with the strict ten students per year quota that seems to be in place? (This assumption follows from the fact that both Gryffindor and Slytherin have exactly ten students in the first year, five male and five female.)

Anyone have any thoughts? Or am I just taking this way too far? (By the way, Happy Fourth of July and all that.)