Count solutions