Python Count True Values In Array Definition In Math