Run the query.
Then run a second query to count the rows:
select found_rows()
It is documented here.
EDIT:
To get the total without rows, use the SQL_CALC_FOUND_ROWS
keyword it the select
:
select SQL_CALC_FOUND_ROWS . . .
Then found_rows()
will return the total without the limit
.