select count(*) from (select sid,avg(score) from SC group by 1 having avg(score) >60 and count(cid) = 3)a