There are 26 letters to choose from for the first letter; 26 for the second letter; 26 for the third letter; and 1 for the last letter (it must be the same as the first letter). This gives us
16 red cars and 12 black cars. He put half of each colour in each box. Therefore he would put 8 red and 6 black in each box. 8 red + 6 black is 14. Therefore he would have 14 cars in each box.