def count_non_zero(vector):
    """Count the number of non-zero values in the vector
        @arg vector list() of integers
        @return the number of non-zero values
    """
    cnt = 0
    for val in vector:
        if val != 0:
            cnt += 1
    return cnt