Probably the easiest way is to simply run a SQL query like this, using the native MySQL functions.
SELECT COUNT(*) FROM qa_posts WHERE type='Q'
Alternatively, you can access Q2A outside of Q2A using the code here. You should be able to run a query using the function qa_db_query_raw.