a person starts writing all 4 digit numbers .how many times had he written the digit 2