#Z15408. 数字统计

数字统计

Description

Please count the number of times the digit 2 appears in all integers within a given range [L, R].
For example, given the range [2, 22], the digit 2 appears once in the number 2, once in 12, once in 20, once in 21, and twice in 22. Therefore, the digit 2 appears a total of 6 times in this range.

Input Format

The input consists of 1 line containing two positive integers L and R, separated by a space.

Output Format

The output consists of 1 line, indicating the total number of times the digit 2 appears.

2 22

6

2 100
20