Calculate totalNVecCells.