count change (scala)