def num_zero(n):
    """ 
    Number of modes with nonzero horizontal wavenumber in the 
    system with n total modes of the HK hierarchy.
    """
    shells = [4,10,18,28,40,54,70,88,108,130,154,180,208,238]
    return min([i+1 for i in range(len(shells)) if shells[i] >= n])