Note: \( p \) is the number of doubly-degenerate levels and \( n \) is the number of pairs of fermions.