Calculate how many numbers below a given number contains a digit.