This paper proposes a method for automatic determination of the number of trees in genetic programming with control nodes (GP CN ). GP CN is genetic programing with multiple trees. An individual in GP CN comprises multiple trees, and each tree has a number P that indicates the number of repetitive actions based on the tree. In previous work, a method for inheriting the number P has been proposed to determine the number P in evolution. In this work, a method to determine the number of trees M in evolution is proposed. First, the fitness is changed to an advantageous fitness for individuals with small M. Second, a semantics for an agent's problem is proposed. Third mutation of the individual is proposed to generate individuals with various M for searching a suitable M.