Formatting and return number of messages.