select count(*) from
(select co.country_name, 
       c.cust_state_province,
       SUM(mv.dollar_sales) AS dollar_sales
FROM  cust_sales_mv mv, 
      (SELECT DISTINCT cust_id, cust_state_province, country_id FROM customers) c, 
      countries co   
WHERE mv.cust_id = c.cust_id
AND   c.country_id = co.country_id
GROUP BY co.country_name, c.cust_state_province
ORDER BY 1,2);
