Helper method for getting total count of rows.