The number of signals that can be made with 3 flags each of different colour by hoisting 1 or 2 or 3 above the other is