select
    count(*)
from
    (
        select
            sid,
            sum(score) as total
        from
            SC
        group by
            sid
        having
            total > 180
    ) d