Digital fingerprinting is to embed information into multimedia contents in order to trace illegal users who distribute pirated copies. One of the serious problems in a fingerprinting system is collusion attack such that several users combine individual copies to remove/modify the embedded fingerprints. As a technique for resisting collusion attacks, Kuribayashi et. al have proposed hierarchical spread spectrum fingerprinting scheme based on the CDMA technique. In this paper, we focus on the number of IDs assigned to each layer, and adjust the assignment for each layer. By optimizing the number of IDs from the theoretical viewpoint, we can effectively decrease the number of elements to be examined, which result in the decrease of the number of false-positive detection without degrading collusion resistance.