Python Uses The Matrix Function To Count