According to your algorithm, 24 ÷ 6 = 4 and 4 ÷ 2 = 2, so there are two strains respectively.
It is indeed two willows and two peaches. . . So your method is right ~ ~