We have given two shorts which are black and blue in colour. Take it as T black and T blue.
Also, we have 3 shirts, coloured white, blue and red denoted by S white, S blue and S red.
Now fix T black and then T blue the different combinations are
Thus we get a total of 6 combinations as
Black short and White shirt
Black short and Blue shirt
Black short and Redshirt
Blue short and White shirt
Blue short and Blue shirt
Blue short and Redshirt.
But it is given short and the shirt is of different colours.
We give up Blue short and Blue shirt combination. So we have 5 different combinations.