Three flags, each of different color, are available for a military exercise. Using these flags, different codes can be generated by waving:
(1) single flag of different colors, or
(2) any two flags in a different sequence of colors, or
(3) three flags in a different sequence of colors.
The maximum number of codes that can be generated is: