count messages and threads