SELECT COUNT(elementos.materia_id) FROM elementos WHERE elementos.materia_id IN(SELECT materia_id FROM materias)