<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nnz(self):
 """ Returns the number of lower-triangular nonzeros. """

        nnz = 0
        for k in range(len(self.snpost)):
            nn = self.snptr[k+1]-self.snptr[k]    
            na = self.relptr[k+1]-self.relptr[k]
            nnz += nn*(nn+1)/2 + nn*na
        return nnz