Assuming each gene has two alleles, or alternate genes, there are 64 squares in a trihybrid cross Punnett square. When there is an independent assortment of genes, the number of combinations is two raised to the power of the number of genes.
Two to the third power is eight, so there are eight possible combinations for each parent. The number of squares in the Punnett square is 8 x 8, which is 64. Labelling the genes as A, B and C gives the combinations: ABC, ABc, AbC, Abc, aBC, aBc, abC, and abc. This leads to a phenotypic ratio of 27.