SELECT COUNT(*) FROM (SELECT   c.cust_last_name, sum(s.amount_sold) AS dollars,
                        sum(s.quantity_sold) as quantity
                      FROM     sales s , customers c, products p
                      WHERE    c.cust_id = s.cust_id
                        AND    s.prod_id = p.prod_id
                        AND    c.cust_state_province IN ('Dublin','Galway')
                      GROUP BY c.cust_last_name);