# Cards in a Deck

**Discrete Mathematics**Level 4

Every card in a deck has a picture of one shape - circle, square, or triangle, which is painted in one of three colors - red, blue, or green. Furthermore, each color is applied in one of three shades - light, medium, or dark. The deck has 27 cards, with every shape -color -shade combination represented. A set of three cards from the deck is called complementary if all of the following statements are true

1) Either each of the three cards has a different shape or all three of the cards have the same shape.

2) Either each of the three cards has a different color or all three of the cards have the same color.

3) Either each of the three cards has a different shade or all three of the cards have the same shade.

How many different complementary three-card sets are there?