The cmdlet below will show you how to find the total number of mailboxes on Exchange Server 2013 and 2010.
Share mailboxes (Get-Recipient -RecipientTypeDetails sharedmailbox -ResultSize Unlimited).count
User Mailbxes (Get-Recipient -RecipientTypeDetails usermailbox -ResultSize Unlimited).count
Room Mailboxes (Get-Recipient -RecipientTypeDetails roommailbox -ResultSize Unlimited).count