Awkward Number
View as PDFWe define an "Awkward Number" a number that meets the following requirement:
The number must have each of the digits
9,4, and1appear at least once, and there may be no other digits that exist.
Given , Andrew wants you to calculate the number of Awkward Number's that appear from
to
.
Input Specification
The first and only line of input will contain an integer , such that
.
Output Specification
The output will contain a single integer, the number of Awkward Number's that exist from to
, inclusive.
Sample Input 1
1000
Sample Output 1
6
Sample Explanation
For the first sample, the 6 Awkward Numbers are 149, 194, 419, 491, 914, and 941.
Comments