added a function to count number of SMS per message