Is the next sentence syntactically and semantically acceptable?

How many did you buy of those pies at the fair?
acceptable