If you don’t need to display the count on your website, the best way is to look in your database. The bp_messages_messages
table will likely have lots of rows. The total number of rows will be the total number of messages sent.
Running SELECT COUNT(*) FROM table_name;
at the mysql terminal prompt will give you the info you need.
Ref: http://dev.mysql.com/doc/refman/5.7/en/counting-rows.html
Else you can use phpMyAdmin if you prefer a GUI.