The numbers 1447,1005 and 1231 have something in common: each is a 4-digit number beginning with 1 that has exactly two identical digits. How many such numbers are there?

(第一届AIME1983 第十题)