You don't say what applicaton language you are using, but most offer a pg_num_rows() interface which tells you how many results are in the recordset you have fetched.
my query uses LIMIT and OFFSET - so pg_num_rows will return what i specify in LIMIT (or less). that's not the count i was asking for.